diff --git a/.claude/settings.local.json b/.claude/settings.local.json
new file mode 100644
index 00000000..c48a05d9
--- /dev/null
+++ b/.claude/settings.local.json
@@ -0,0 +1,13 @@
+{
+ "permissions": {
+ "allow": [
+ "Bash(env)",
+ "Bash(curl:*)",
+ "Bash(git remote remove:*)",
+ "Bash(git remote set-url:*)",
+ "Bash(git add:*)"
+ ],
+ "deny": [],
+ "ask": []
+ }
+}
\ No newline at end of file
diff --git a/CLAUDE.md b/CLAUDE.md
new file mode 100644
index 00000000..ea312ea6
--- /dev/null
+++ b/CLAUDE.md
@@ -0,0 +1,147 @@
+# CLAUDE.md
+
+This file provides guidance to Claude Code when working with this Vulkan-based 3D engine codebase.
+
+## Project Overview
+
+A modern Vulkan-based 3D engine built on Sascha Willems' Vulkan examples framework, featuring procedural shape generation, scene management, and ImGui integration. The engine uses dynamic rendering (VK_KHR_dynamic_rendering) and C++20 standards.
+
+## Build System
+
+### Quick Build
+```bash
+# From project root (inihb/)
+mkdir build && cd build
+cmake .. && cmake --build . --config Release
+```
+
+### Platform-Specific
+- **Windows**: `cmake .. -G "Visual Studio 16 2019" -A x64`
+- **Linux**: `cmake .. && make -j$(nproc)`
+- **Output**: `build/bin/Release/ProceduralEngine3D.exe`
+
+### Dependencies
+- Vulkan SDK (required)
+- C++20 compatible compiler
+- CMake 3.10.0+
+
+## Architecture
+
+### Core Systems
+- **Application** (`src/core/Application.cpp`): Main Vulkan application class inheriting from VulkanExampleBase
+- **Base Framework** (`base/`): Sascha Willems' Vulkan infrastructure
+- **Scene Management** (`src/scene/`): Object and shape management
+- **UI System** (`src/ui/`): ImGui-based interface
+- **Camera System** (`base/camera.hpp`): Orbit camera with focus functionality
+
+### Vulkan Features
+- Dynamic rendering (no render passes/framebuffers)
+- Modern Vulkan 1.3+ practices
+- Multi-platform window system integration
+- Validation layer support
+
+## Key Files
+
+### Core Components
+- `src/core/Application.cpp` - Main application class with Vulkan setup
+- `base/camera.hpp` - Camera system with orbit mode and F key focus
+- `src/scene/SceneManager.cpp` - Scene graph and object management
+- `src/ui/UIManager.cpp` - ImGui integration and panels
+
+### Vulkan Infrastructure (Sascha Willems Base)
+- `base/VulkanExampleBase.h` - Main Vulkan framework
+- `base/VulkanDevice.hpp` - Vulkan device abstraction
+- `base/VulkanSwapChain.hpp` - Swapchain management
+- `base/VulkanBuffer.hpp` - Buffer utilities
+
+### Build Configuration
+- `CMakeLists.txt` - Main build configuration
+- `BUILD.md` - Detailed build instructions
+
+## Camera System
+
+### F Key Focus Feature
+The camera system supports focusing on selected objects:
+- Press **F** to focus camera on selected object
+- Automatically calculates optimal viewing distance
+- Switches to orbit mode around focused object
+- Mouse rotation orbits around the focused object center
+
+### Implementation Details
+- `camera.focusOnObject()` - Sets orbit center and optimal distance
+- `camera.updateOrbitPosition()` - Handles spherical coordinate positioning
+- Hybrid system: standard Sascha camera + orbit mode using `glm::lookAt()`
+
+## Development Guidelines
+
+### Testing Changes
+1. Build with `cmake --build . --config Release`
+2. Run from `build/bin/Release/`
+3. Use **F** key to test camera focus functionality
+4. Check console output for debug information
+
+### Vulkan Debugging
+- Enable validation layers with `-v` command line flag
+- Use `--listgpus` to see available Vulkan devices
+- Check `VK_LAYER_KHRONOS_validation` environment variable
+
+### Adding Features
+- Follow Sascha Willems patterns for Vulkan code
+- Use dynamic rendering (no render passes)
+- Implement proper buffer management and synchronization
+- Add ImGui panels for new features
+
+## Common Tasks
+
+### Build and Run
+```bash
+cd build
+cmake --build . --config Release
+bin/Release/ProceduralEngine3D.exe
+```
+
+### Shader Compilation
+Shaders are in GLSL and compiled to SPIR-V:
+- Location: `shaders/glsl/`
+- Compiled automatically during build
+- Use `glslc` or `glslangValidator` for manual compilation
+
+### Clean Build
+```bash
+rm -rf build && mkdir build && cd build
+cmake .. && cmake --build . --config Release
+```
+
+### Camera Controls
+- **Mouse**: Look around (standard mode) or orbit (after F key focus)
+- **WASD**: Move camera
+- **F**: Focus on selected object
+- **Mouse Wheel**: Zoom (in orbit mode changes distance)
+
+## Command Line Options
+
+Available options (use `--help` for full list):
+- `-v, --validation`: Enable validation layers
+- `-w, --width`: Set window width
+- `-h, --height`: Set window height
+- `-f, --fullscreen`: Start in fullscreen
+- `-g, --gpu`: Select GPU device
+- `--listgpus`: List available Vulkan devices
+
+## Technical Notes
+
+### Modern Vulkan Usage
+- Uses `VK_KHR_dynamic_rendering` extension
+- No traditional render passes or framebuffers
+- Leverages Vulkan 1.3+ features where available
+- Proper synchronization with timeline semaphores
+
+### Memory Management
+- Buffer utilities handle staging automatically
+- Proper cleanup in destructors
+- Device memory allocation through base framework
+
+### Threading
+- Single-threaded main loop
+- Vulkan command buffer recording on main thread
+- UI rendering integrated with main render loop
\ No newline at end of file
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3455a65d..00a0fcd1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,13 +4,12 @@
cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
-set(NAME vulkanExamples)
+set(NAME inihb)
project(${NAME})
include_directories(external)
include_directories(external/glm)
-include_directories(external/gli)
include_directories(external/imgui)
include_directories(external/tinygltf)
include_directories(external/ktx/include)
@@ -179,4 +178,4 @@ ENDIF(WIN32)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/")
add_subdirectory(base)
-add_subdirectory(examples)
+add_subdirectory(src)
diff --git a/README.md b/README.md
index 41a949cb..b21c505e 100644
--- a/README.md
+++ b/README.md
@@ -1,511 +1,197 @@
-# Vulkan C++ examples and demos
+# Procedural 3D Engine
-A comprehensive collection of open source C++ examples for [Vulkan®](https://www.vulkan.org), the low-level graphics and compute API from Khronos.
-
-[](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BHXPMV6ZKPH9E)
+A modern Vulkan-based 3D engine featuring procedural shape generation, scene management, and ImGui integration. Built on top of Sascha Willems' Vulkan examples framework with dynamic rendering support and C++20 standards.
## Table of Contents
-+ [Official Khronos Vulkan Samples](#official-khronos-vulkan-samples)
-+ [Cloning](#Cloning)
-+ [Assets](#Assets)
-+ [Building](#Building)
-+ [Running](#Running)
-+ [Shaders](#Shaders)
-+ [A note on synchronization](#a-note-on-synchronization)
-+ [Examples](#Examples)
- + [Basics](#Basics)
- + [glTF](#glTF)
- + [Advanced](#Advanced)
- + [Performance](#Performance)
- + [Physically Based Rendering](#physically-based-rendering)
- + [Deferred](#Deferred)
- + [Compute Shader](#compute-shader)
- + [Geometry Shader](#geometry-shader)
- + [Tessellation Shader](#tessellation-shader)
- + [Hardware accelerated ray tracing](#hardware-accelerated-ray-tracing)
- + [Headless](#Headless)
- + [User Interface](#user-interface)
- + [Effects](#Effects)
- + [Extensions](#Extensions)
- + [Misc](#Misc)
++ [Features](#features)
++ [Requirements](#requirements)
++ [Building](#building)
++ [Running](#running)
++ [Architecture](#architecture)
++ [Camera System](#camera-system)
++ [Development](#development)
++ [Vulkan Examples](#vulkan-examples)
+ [Credits and Attributions](#credits-and-attributions)
-## Official Khronos Vulkan Samples
+## Features
-Khronos has made an official Vulkan Samples repository available to the public ([press release](https://www.khronos.org/blog/vulkan-releases-unified-samples-repository?utm_source=Khronos%20Blog&utm_medium=Twitter&utm_campaign=Vulkan%20Repository)).
+- **Modern Vulkan Rendering**: Built on Vulkan 1.3+ with dynamic rendering (VK_KHR_dynamic_rendering)
+- **Procedural Shape Generation**: Generate and manipulate 3D shapes procedurally
+- **Scene Management**: Hierarchical scene graph with object management
+- **ImGui Integration**: Real-time UI for parameter adjustment and debugging
+- **Advanced Camera System**: Orbit camera with focus functionality (F key)
+- **Cross-Platform**: Windows, Linux, and macOS support
+- **C++20 Standards**: Modern C++ codebase with latest language features
-You can find this repository at https://github.com/KhronosGroup/Vulkan-Samples
+## Requirements
-As I've been involved with getting the official repository up and running, I'll be mostly contributing to that repository from now, but may still add samples that don't fit there in here and I'll of course continue to maintain these samples.
+### Software Dependencies
+- **Vulkan SDK** 1.3.0 or higher (required)
+- **CMake** 3.10.0 or higher
+- **C++20** compatible compiler:
+ - Visual Studio 2019/2022 (Windows)
+ - GCC 10+ or Clang 13+ (Linux)
+ - Xcode 13+ (macOS)
-## Cloning
-This repository contains submodules for external dependencies and assets, so when doing a fresh clone you need to clone recursively:
-
-```
-git clone --recursive https://github.com/SaschaWillems/Vulkan.git
-```
-
-Existing repositories can be updated manually:
-
-```
-git submodule init
-git submodule update
-```
+### Hardware Requirements
+- Vulkan-compatible GPU
+- 2GB+ VRAM recommended
+- GPU with dynamic rendering support preferred
## Building
-The repository contains everything required to compile and build the examples on Windows, Android, iOS and macOS (using MoltenVK) using a C++ compiler that supports C++20.
+### Quick Build (All Platforms)
+```bash
+# From project root directory
+mkdir build && cd build
+cmake .. && cmake --build . --config Release
+```
-See [BUILD.md](BUILD.md) for details on how to build for the different platforms.
+### Platform-Specific Build
+
+#### Windows (Visual Studio)
+```bash
+mkdir build && cd build
+cmake .. -G "Visual Studio 16 2019" -A x64
+cmake --build . --config Release
+```
+
+#### Linux
+```bash
+mkdir build && cd build
+cmake .. && make -j$(nproc)
+```
+
+#### macOS
+```bash
+mkdir build && cd build
+cmake .. && make -j$(sysctl -n hw.ncpu)
+```
+
+### Output Location
+- **Executable**: `build/bin/Release/ProceduralEngine3D.exe` (Windows) or `build/bin/Release/ProceduralEngine3D` (Unix)
+- **Assets**: Automatically copied to output directory
+
+For detailed build instructions, see [BUILD.md](BUILD.md).
## Running
-Once built, examples can be run from the bin directory. The list of available command line options can be brought up with `--help`:
+### Basic Usage
+```bash
+# From build output directory
+cd build/bin/Release
+./ProceduralEngine3D
```
- --help: Show help
- -h, --height: Set window height
- -v, --validation: Enable validation layers
- -vs, --vsync: Enable V-Sync
- -f, --fullscreen: Start in fullscreen mode
- -w, --width: Set window width
- -s, --shaders: Select shader type to use (glsl, slang, hlsl)
- -g, --gpu: Select GPU to run on
- -gl, --listgpus: Display a list of available Vulkan devices
- -b, --benchmark: Run example in benchmark mode
- -bw, --benchwarmup: Set warmup time for benchmark mode in seconds
- -br, --benchruntime: Set duration time for benchmark mode in seconds
- -bf, --benchfilename: Set file name for benchmark results
- -bt, --benchframetimes: Save frame times to benchmark results file
- -bfs, --benchmarkframes: Only render the given number of frames
- -rp, --resourcepath: Set path for dir where assets and shaders folder is present
+
+### Command Line Options
+Use `--help` to see all available options:
+```bash
+./ProceduralEngine3D --help
```
-Note that some examples require specific device features, and if you are on a multi-gpu system you might need to use the `-gl` and `-g` to select a gpu that supports them.
-## Shaders
-
-Vulkan consumes shaders in an intermediate representation called SPIR-V. This makes it possible to use different shader languages by compiling them to that bytecode format. The primary shader language used here is [GLSL](shaders/glsl), most samples also come with [slang](shaders/slang/) and [HLSL](shaders/hlsl) shader sources, making it easy to compare the differences between those shading languages. The [Rust GPU](https://rust-gpu.github.io/) project maintains [Rust](https://www.rust-lang.org/) shader sources in a [separate repo](https://github.com/Rust-GPU/VulkanShaderExamples/tree/master/shaders/rust).
-
-## A note on synchronization
-
-Synchronization in the master branch currently isn't optimal und uses ```vkDeviceQueueWaitIdle``` at the end of each frame. This is a heavy operation and is suboptimal in regards to having CPU and GPU operations run in parallel. I'm currently reworking this in the [this branch](https://github.com/SaschaWillems/Vulkan/tree/sync_rework_second_attempt). While still work-in-progress, if you're interested in a more proper way of synchronization in Vulkan, please take a look at the [PR for that branch](https://github.com/SaschaWillems/Vulkan/pull/1224) to see progress.
-
-## Examples
-
-### Basics
-
-- [Basic triangle using Vulkan 1.0](examples/triangle/)
-
- Basic and verbose example for getting a colored triangle rendered to the screen using Vulkan. This is meant as a starting point for learning Vulkan from the ground up. A huge part of the code is boilerplate that is abstracted away in later examples.
-
-- [Basic triangle using Vulkan 1.3](examples/trianglevulkan13//)
-
- Vulkan 1.3 version of the basic and verbose example for getting a colored triangle rendered to the screen. This makes use of features like dynamic rendering simplifying api usage.
-
-- [Pipelines](examples/pipelines/)
-
- Using pipeline state objects (pso) that bake state information (rasterization states, culling modes, etc.) along with the shaders into a single object, making it easy for an implementation to optimize usage (compared to OpenGL's dynamic state machine). Also demonstrates the use of pipeline derivatives.
-
-- [Descriptor sets](examples/descriptorsets)
-
- Descriptors are used to pass data to shader binding points. Sets up descriptor sets, layouts, pools, creates a single pipeline based on the set layout and renders multiple objects with different descriptor sets.
-
-- [Dynamic uniform buffers](examples/dynamicuniformbuffer/)
-
- Dynamic uniform buffers are used for rendering multiple objects with multiple matrices stored in a single uniform buffer object. Individual matrices are dynamically addressed upon descriptor binding time, minimizing the number of required descriptor sets.
-
-- [Push constants](examples/pushconstants/)
-
- Uses push constants, small blocks of uniform data stored within a command buffer, to pass data to a shader without the need for uniform buffers.
-
-- [Specialization constants](examples/specializationconstants/)
-
- Uses SPIR-V specialization constants to create multiple pipelines with different lighting paths from a single "uber" shader.
-
-- [Texture mapping](examples/texture/)
-
- Loads a 2D texture from disk (including all mip levels), uses staging to upload it into video memory and samples from it using combined image samplers.
-
-- [Texture arrays](examples/texturearray/)
-
- Loads a 2D texture array containing multiple 2D texture slices (each with its own mip chain) and renders multiple meshes each sampling from a different layer of the texture. 2D texture arrays don't do any interpolation between the slices.
-
-- [Cube map textures](examples/texturecubemap/)
-
- Loads a cube map texture from disk containing six different faces. All faces and mip levels are uploaded into video memory, and the cubemap is displayed on a skybox as a backdrop and on a 3D model as a reflection.
-
-- [Cube map arrays](examples/texturecubemaparray/)
-
- Loads an array of cube map textures from a single file. All cube maps are uploaded into video memory with their faces and mip levels, and the selected cubemap is displayed on a skybox as a backdrop and on a 3D model as a reflection.
-
-- [3D textures](examples/texture3d/)
-
- Generates a 3D texture on the cpu (using perlin noise), uploads it to the device and samples it to render an animation. 3D textures store volumetric data and interpolate in all three dimensions.
-
-- [Input attachments](examples/inputattachments)
-
- Uses input attachments to read framebuffer contents from a previous sub pass at the same pixel position within a single render pass. This can be used for basic post processing or image composition ([blog entry](https://www.saschawillems.de/tutorials/vulkan/input_attachments_subpasses)).
-
-- [Sub passes](examples/subpasses/)
-
- Advanced example that uses sub passes and input attachments to write and read back data from framebuffer attachments (same location only) in single render pass. This is used to implement deferred render composition with added forward transparency in a single pass.
-
-- [Offscreen rendering](examples/offscreen/)
-
- Basic offscreen rendering in two passes. First pass renders the mirrored scene to a separate framebuffer with color and depth attachments, second pass samples from that color attachment for rendering a mirror surface.
-
-- [CPU particle system](examples/particlesystem/)
-
- Implements a simple CPU based particle system. Particle data is stored in host memory, updated on the CPU per-frame and synchronized with the device before it's rendered using pre-multiplied alpha.
-
-- [Stencil buffer](examples/stencilbuffer/)
-
- Uses the stencil buffer and its compare functionality for rendering a 3D model with dynamic outlines.
-
-- [Vertex attributes](examples/vertexattributes/)
-
- Demonstrates two different ways of passing vertices to the vertex shader using either interleaved or separate vertex attributes.
-
-### glTF
-
-These samples show how implement different features of the [glTF 2.0 3D format](https://www.khronos.org/gltf/) 3D transmission file format in detail.
-
-- [glTF model loading and rendering](examples/gltfloading/)
-
- Shows how to load a complete scene from a [glTF 2.0](https://github.com/KhronosGroup/glTF) file. The structure of the glTF 2.0 scene is converted into the data structures required to render the scene with Vulkan.
-
-- [glTF vertex skinning](examples/gltfskinning/)
-
- Demonstrates how to do GPU vertex skinning from animation data stored in a [glTF 2.0](https://github.com/KhronosGroup/glTF) model. Along with reading all the data structures required for doing vertex skinning, the sample also shows how to upload animation data to the GPU and how to render it using shaders.
-
-- [glTF scene rendering](examples/gltfscenerendering/)
-
- Renders a complete scene loaded from an [glTF 2.0](https://github.com/KhronosGroup/glTF) file. The sample is based on the glTF model loading sample, and adds data structures, functions and shaders required to render a more complex scene using Crytek's Sponza model with per-material pipelines and normal mapping.
-
-### Advanced
-
-- [Multi sampling](examples/multisampling/)
-
- Implements multisample anti-aliasing (MSAA) using a renderpass with multisampled attachments and resolve attachments that get resolved into the visible frame buffer.
-
-- [High dynamic range](examples/hdr/)
-
- Implements a high dynamic range rendering pipeline using 16/32 bit floating point precision for all internal formats, textures and calculations, including a bloom pass, manual exposure and tone mapping.
-
-- [Shadow mapping](examples/shadowmapping/)
-
- Rendering shadows for a directional light source. First pass stores depth values from the light's pov, second pass compares against these to check if a fragment is shadowed. Uses depth bias to avoid shadow artifacts and applies a PCF filter to smooth shadow edges.
-
-- [Cascaded shadow mapping](examples/shadowmappingcascade/)
-
- Uses multiple shadow maps (stored as a layered texture) to increase shadow resolution for larger scenes. The camera frustum is split up into multiple cascades with corresponding layers in the shadow map. Layer selection for shadowing depth compare is then done by comparing fragment depth with the cascades' depths ranges.
-
-- [Omnidirectional shadow mapping](examples/shadowmappingomni/)
-
- Uses a dynamic floating point cube map to implement shadowing for a point light source that casts shadows in all directions. The cube map is updated every frame and stores distance to the light source for each fragment used to determine if a fragment is shadowed.
-
-- [Run-time mip-map generation](examples/texturemipmapgen/)
-
- Generating a complete mip-chain at runtime instead of loading it from a file, by blitting from one mip level, starting with the actual texture image, down to the next smaller size until the lower 1x1 pixel end of the mip chain.
-
-- [Capturing screenshots](examples/screenshot/)
-
- Capturing and saving an image after a scene has been rendered using blits to copy the last swapchain image from optimal device to host local linear memory, so that it can be stored into a ppm image.
-
-- [Order Independent Transparency](examples/oit)
-
- Implements order independent transparency based on linked lists. To achieve this, the sample uses storage buffers in combination with image load and store atomic operations in the fragment shader.
-
-### Performance
-
-- [Multi threaded command buffer generation](examples/multithreading/)
-
- Multi threaded parallel command buffer generation. Instead of prebuilding and reusing the same command buffers this sample uses multiple hardware threads to demonstrate parallel per-frame recreation of secondary command buffers that are executed and submitted in a primary buffer once all threads have finished.
-
-- [Instancing](examples/instancing/)
-
- Uses the instancing feature for rendering many instances of the same mesh from a single vertex buffer with variable parameters and textures (indexing a layered texture). Instanced data is passed using a secondary vertex buffer.
-
-- [Indirect drawing](examples/indirectdraw/)
-
- Rendering thousands of instanced objects with different geometry using one single indirect draw call instead of issuing separate draws. All draw commands to be executed are stored in a dedicated indirect draw buffer object (storing index count, offset, instance count, etc.) that is uploaded to the device and sourced by the indirect draw command for rendering.
-
-- [Occlusion queries](examples/occlusionquery/)
-
- Using query pool objects to get number of passed samples for rendered primitives got determining on-screen visibility.
-
-- [Pipeline statistics](examples/pipelinestatistics/)
-
- Using query pool objects to gather statistics from different stages of the pipeline like vertex, fragment shader and tessellation evaluation shader invocations depending on payload.
-
-### Physically Based Rendering
-
-Physical based rendering as a lighting technique that achieves a more realistic and dynamic look by applying approximations of bidirectional reflectance distribution functions based on measured real-world material parameters and environment lighting.
-
-- [PBR basics](examples/pbrbasic/)
-
- Demonstrates a basic specular BRDF implementation with solid materials and fixed light sources on a grid of objects with varying material parameters, demonstrating how metallic reflectance and surface roughness affect the appearance of pbr lit objects.
-
-- [PBR image based lighting](examples/pbribl/)
-
- Adds image based lighting from an hdr environment cubemap to the PBR equation, using the surrounding environment as the light source. This adds an even more realistic look the scene as the light contribution used by the materials is now controlled by the environment. Also shows how to generate the BRDF 2D-LUT and irradiance and filtered cube maps from the environment map.
-
-- [Textured PBR with IBL](examples/pbrtexture/)
-
- Renders a model specially crafted for a metallic-roughness PBR workflow with textures defining material parameters for the PRB equation (albedo, metallic, roughness, baked ambient occlusion, normal maps) in an image based lighting environment.
-
-### Deferred
-
-These examples use a [deferred shading](https://en.wikipedia.org/wiki/Deferred_shading) setup.
-
-- [Deferred shading basics](examples/deferred/)
-
- Uses multiple render targets to fill all attachments (albedo, normals, position, depth) required for a G-Buffer in a single pass. A deferred pass then uses these to calculate shading and lighting in screen space, so that calculations only have to be done for visible fragments independent of no. of lights.
-
-- [Deferred multi sampling](examples/deferredmultisampling/)
-
- Adds multi sampling to a deferred renderer using manual resolve in the fragment shader.
-
-- [Deferred shading shadow mapping](examples/deferredshadows/)
-
- Adds shadows from multiple spotlights to a deferred renderer using a layered depth attachment filled in one pass using multiple geometry shader invocations.
-
-- [Screen space ambient occlusion](examples/ssao/)
-
- Adds ambient occlusion in screen space to a 3D scene. Depth values from a previous deferred pass are used to generate an ambient occlusion texture that is blurred before being applied to the scene in a final composition path.
-
-### Compute Shader
-
-All Vulkan implementations support compute shaders, a more generalized way of doing workloads on the GPU. These samples demonstrate how to use those compute shaders.
-
-- [Image processing](examples/computeshader/)
-
- Uses a compute shader along with a separate compute queue to apply different convolution kernels (and effects) on an input image in realtime.
-
-- [GPU particle system](examples/computeparticles/)
-
- Attraction based 2D GPU particle system using compute shaders. Particle data is stored in a shader storage buffer and only modified on the GPU using memory barriers for synchronizing compute particle updates with graphics pipeline vertex access.
-
-- [N-body simulation](examples/computenbody/)
-
- N-body simulation based particle system with multiple attractors and particle-to-particle interaction using two passes separating particle movement calculation and final integration. Shared compute shader memory is used to speed up compute calculations.
-
-- [Ray tracing](examples/computeraytracing/)
-
- Simple GPU ray tracer with shadows and reflections using a compute shader. No scene geometry is rendered in the graphics pass.
-
-- [ Cloth simulation](examples/computecloth/)
-
- Mass-spring based cloth system on the GPU using a compute shader to calculate and integrate spring forces, also implementing basic collision with a fixed scene object.
-
-- [Cull and LOD](examples/computecullandlod/)
-
- Purely GPU based frustum visibility culling and level-of-detail system. A compute shader is used to modify draw commands stored in an indirect draw commands buffer to toggle model visibility and select its level-of-detail based on camera distance, no calculations have to be done on and synced with the CPU.
-
-### Geometry Shader
-
-- [Normal debugging](examples/geometryshader/)
-
- Visualizing per-vertex model normals (for debugging). First pass renders the plain model, second pass uses a geometry shader to generate colored lines based on per-vertex model normals,
-
-- [Viewport arrays](examples/viewportarray/)
-
- Renders a scene to multiple viewports in one pass using a geometry shader to apply different matrices per viewport to simulate stereoscopic rendering (left/right). Requires a device with support for ```multiViewport```.
-
-### Tessellation Shader
-
-- [Displacement mapping](examples/displacement/)
-
- Uses a height map to dynamically generate and displace additional geometric detail for a low-poly mesh.
-
-- [Dynamic terrain tessellation](examples/terraintessellation/)
-
- Renders a terrain using tessellation shaders for height displacement (based on a 16-bit height map), dynamic level-of-detail (based on triangle screen space size) and per-patch frustum culling.
-
-- [Model tessellation](examples/tessellation/)
-
- Uses curved PN-triangles ([paper](http://alex.vlachos.com/graphics/CurvedPNTriangles.pdf)) for adding details to a low-polygon model.
-
-### Hardware accelerated ray tracing
-
-Vulkan supports GPUs with dedicated hardware for ray tracing. These sampples show different parts of that functionality.
-
-- [Basic ray tracing](examples/raytracingbasic)
-
- Basic example for doing hardware accelerated ray tracing using the ```VK_KHR_acceleration_structure``` and ```VK_KHR_ray_tracing_pipeline``` extensions. Shows how to setup acceleration structures, ray tracing pipelines and the shader binding table needed to do the actual ray tracing.
-
-- [Ray traced shadows](examples/raytracingshadows)
-
- Adds ray traced shadows casting using the new ray tracing extensions to a more complex scene. Shows how to add multiple hit and miss shaders and how to modify existing shaders to add shadow calculations.
-
-- [Ray traced reflections](examples/raytracingreflections)
-
- Renders a complex scene with reflective surfaces using the new ray tracing extensions. Shows how to do recursion inside of the ray tracing shaders for implementing real time reflections.
-
-- [Ray traced texture mapping](examples/raytracingtextures)
-
- Renders a texture mapped quad with transparency using the new ray tracing extensions. Shows how to do texture mapping in a closes hit shader, how to cancel intersections for transparency in an any hit shader and how to access mesh data in those shaders using buffer device addresses.
-
-- [Callable ray tracing shaders](examples/raytracingcallable)
-
- Callable shaders can be dynamically invoked from within other ray tracing shaders to execute different shaders based on dynamic conditions. The example ray traces multiple geometries, with each calling a different callable shader from the closest hit shader.
-
-- [Ray tracing intersection shaders](examples/raytracingintersection)
-
- Uses an intersection shader for procedural geometry. Instead of using actual geometry, this sample on passes bounding boxes and object definitions. An intersection shader is then used to trace against the procedural objects.
-
-- [Ray traced glTF](examples/raytracinggltf/)
-
- Renders a textured glTF model using ray traying instead of rasterization. Makes use of frame accumulation for transparency and anti aliasing.
-
-- [Ray query](examples/rayquery)
-
- Ray queries add acceleration structure intersection functionality to non ray tracing shader stages. This allows for combining ray tracing with rasterization. This example makes uses ray queries to add ray casted shadows to a rasterized sample in the fragment shader.
-
-- [Position fetch](examples/raytracingpositionfetch/)
-
- Uses the `VK_KHR_ray_tracing_position_fetch` extension to fetch vertex position data from the acceleration structure from within a shader, instead of having to manually unpack vertex information.
-
-### Headless
-
-Examples that run one-time tasks and don't make use of visual output (no window system integration). These can be run in environments where no user interface is available ([blog entry](https://www.saschawillems.de/tutorials/vulkan/headless_examples)).
-
-- [Render](examples/renderheadless)
-
- Renders a basic scene to a (non-visible) frame buffer attachment, reads it back to host memory and stores it to disk without any on-screen presentation, showing proper use of memory barriers required for device to host image synchronization.
-
-- [Compute](examples/computeheadless)
-
- Only uses compute shader capabilities for running calculations on an input data set (passed via SSBO). A fibonacci row is calculated based on input data via the compute shader, stored back and displayed via command line.
-
-### User Interface
-
-- [Text rendering](examples/textoverlay/)
-
- Load and render a 2D text overlay created from the bitmap glyph data of a [stb font file](https://nothings.org/stb/font/). This data is uploaded as a texture and used for displaying text on top of a 3D scene in a second pass.
-
-- [Distance field fonts](examples/distancefieldfonts/)
-
- Uses a texture that stores signed distance field information per character along with a special fragment shader calculating output based on that distance data. This results in crisp high quality font rendering independent of font size and scale.
-
-- [ImGui overlay](examples/imgui/)
-
- Generates and renders a complex user interface with multiple windows, controls and user interaction on top of a 3D scene. The UI is generated using [Dear ImGUI](https://github.com/ocornut/imgui) and updated each frame.
-
-### Extensions
-
-Vulkan is an extensible api with lots of functionality added by extensions. These samples demonstrate the usage of such extensions.
-
-**Note:** Certain extensions may become core functionality for newer Vulkan versions. The samples will still work with these.
-
-- [Conservative rasterization (VK_EXT_conservative_rasterization)](examples/conservativeraster/)
-
- Uses conservative rasterization to change the way fragments are generated by the gpu. The example enables overestimation to generate fragments for every pixel touched instead of only pixels that are fully covered ([blog post](https://www.saschawillems.de/tutorials/vulkan/conservative_rasterization)).
-
-- [Push descriptors (VK_KHR_push_descriptor)](examples/pushdescriptors/)
-
- Uses push descriptors apply the push constants concept to descriptor sets. Instead of creating per-object descriptor sets for rendering multiple objects, this example passes descriptors at command buffer creation time.
-
-- [Inline uniform blocks (VK_EXT_inline_uniform_block)](examples/inlineuniformblocks/)
-
- Makes use of inline uniform blocks to pass uniform data directly at descriptor set creation time and also demonstrates how to update data for those descriptors at runtime.
-
-- [Multiview rendering (VK_KHR_multiview)](examples/multiview/)
-
- Renders a scene to to multiple views (layers) of a single framebuffer to simulate stereoscopic rendering in one pass. Broadcasting to the views is done in the vertex shader using ```gl_ViewIndex```.
-
-- [Conditional rendering (VK_EXT_conditional_rendering)](examples/conditionalrender)
-
- Demonstrates the use of VK_EXT_conditional_rendering to conditionally dispatch render commands based on values from a dedicated buffer. This allows e.g. visibility toggles without having to rebuild command buffers ([blog post](https://www.saschawillems.de/tutorials/vulkan/conditional_rendering)).
-
-- [Debug shader printf (VK_KHR_shader_non_semantic_info)](examples/debugprintf/)
-
- Shows how to use printf in a shader to output additional information per invocation. This information can help debugging shader related issues in tools like RenderDoc.
-
- **Note:** This sample should be run from a graphics debugger like RenderDoc.
-
-- [Debug utils (VK_EXT_debug_utils)](examples/debugutils/)
-
- Shows how to use debug utils for adding labels and colors to Vulkan objects for graphics debuggers. This information helps to identify resources in tools like RenderDoc.
-
- **Note:** This sample should be run from a graphics debugger like RenderDoc.
-
-- [Negative viewport height (VK_KHR_Maintenance1 or Vulkan 1.1)](examples/negativeviewportheight/)
-
- Shows how to render a scene using a negative viewport height, making the Vulkan render setup more similar to other APIs like OpenGL. Also has several options for changing relevant pipeline state, and displaying meshes with OpenGL or Vulkan style coordinates. Details can be found in [this tutorial](https://www.saschawillems.de/tutorials/vulkan/flipping-viewport).
-
-- [Variable rate shading (VK_KHR_fragment_shading_rate)](examples/variablerateshading/)
-
- Uses a special image that contains variable shading rates to vary the number of fragment shader invocations across the framebuffer. This makes it possible to lower fragment shader invocations for less important/less noisy parts of the framebuffer.
-
-- [Descriptor indexing (VK_EXT_descriptor_indexing)](examples/descriptorindexing/)
-
- Demonstrates the use of VK_EXT_descriptor_indexing for creating descriptor sets with a variable size that can be dynamically indexed in a shader using `GL_EXT_nonuniform_qualifier` and `SPV_EXT_descriptor_indexing`.
-
-- [Dynamic rendering (VK_KHR_dynamic_rendering)](examples/dynamicrendering/)
-
- Shows usage of the VK_KHR_dynamic_rendering extension, which simplifies the rendering setup by no longer requiring render pass objects or framebuffers.
-
-- [Dynamic rendering with multi sampling (VK_KHR_dynamic_rendering)](examples/dynamicrenderingmultisampling/)
-
- Based on the dynamic rendering sample, this sample shows how to do implement multi sampling with dynamic rendering.
-
-- [Graphics pipeline library (VK_EXT_graphics_pipeline_library)](./examples/graphicspipelinelibrary)
-
- Uses the graphics pipeline library extensions to improve run-time pipeline creation. Instead of creating the whole pipeline at once, this sample pre builds shared pipeline parts like like vertex input state and fragment output state. These are then used to create full pipelines at runtime, reducing build times and possible hick-ups.
-
-- [Mesh shaders (VK_EXT_mesh_shader)](./examples/meshshader)
-
- Basic sample demonstrating how to use the mesh shading pipeline as a replacement for the traditional vertex pipeline.
-
-- [Descriptor buffers (VK_EXT_descriptor_buffer)](./examples/descriptorbuffer/)
-
- Basic sample showing how to use descriptor buffers to replace descriptor sets.
-
-- [Shader objects (VK_EXT_shader_object)](./examples/shaderobjects/)
-
- Basic sample showing how to use shader objects that can be used to replace pipeline state objects. Instead of baking all state in a PSO, shaders are explicitly loaded and bound as separate objects and state is set using dynamic state extensions. The sample also stores binary shader objets and loads them on consecutive runs.
-
-- [Host image copy (VK_EXT_host_image_copy)](./examples/hostimagecopy/)
-
- Shows how to do host image copies, which heavily simplify the host to device image process by fully skipping the staging process.
-
-- [Buffer device address (VK_KHR_buffer_device_addres)](./examples/bufferdeviceaddress/)
-
- Demonstrates the use of virtual GPU addresses to directly access buffer data in shader. Instead of e.g. using descriptors to access uniforms, with this extension you simply provide an address to the memory you want to read from in the shader and that address can be arbitrarily changed e.g. via a push constant.
-
-- [Timeline semaphores (VK_KHR_timeline_semaphore)](./examples/timelinesemaphore/)
-
- Shows how to use a new semaphore type that has a way of setting and identifying a given point on a timeline. Compared to the core binary semaphores, this simplifies synchronization as a single timeline semaphore can replace multiple binary semaphores.
-
-### Effects
-
-Assorted samples showing graphical effects not special to Vulkan.
-
-- [Fullscreen radial blur](examples/radialblur/)
-
- Demonstrates the basics of fullscreen shader effects. The scene is rendered into an offscreen framebuffer at lower resolution and rendered as a fullscreen quad atop the scene using a radial blur fragment shader.
-
-- [Bloom](examples/bloom/)
-
- Advanced fullscreen effect example adding a bloom effect to a scene. Glowing scene parts are rendered to a low res offscreen framebuffer that is applied atop the scene using a two pass separated gaussian blur.
-
-- [Parallax mapping](examples/parallaxmapping/)
-
- Implements multiple texture mapping methods to simulate depth based on texture information: Normal mapping, parallax mapping, steep parallax mapping and parallax occlusion mapping (best quality, worst performance).
-
-- [Spherical environment mapping](examples/sphericalenvmapping/)
-
- Uses a spherical material capture texture array defining environment lighting and reflection information to fake complex lighting.
-
-### Misc
-
-- [Vulkan Gears](examples/gears/)
-
- Vulkan interpretation of glxgears. Procedurally generates and animates multiple gears.
-
-- [Vulkan demo scene](examples/vulkanscene/)
-
- Renders a Vulkan demo scene with logos and mascots. Not an actual example but more of a playground and showcase.
+**Common Options:**
+- `-v, --validation`: Enable Vulkan validation layers (recommended for development)
+- `-w, --width`: Set window width (default: 1920)
+- `-h, --height`: Set window height (default: 1080)
+- `-f, --fullscreen`: Start in fullscreen mode
+- `-g, --gpu`: Select specific GPU device
+- `--listgpus`: Display available Vulkan devices
+
+### Controls
+- **Mouse**: Look around (standard mode) or orbit (after F key focus)
+- **WASD**: Move camera
+- **F**: Focus camera on selected object
+- **Mouse Wheel**: Zoom (in orbit mode changes distance)
+- **ImGui panels**: Adjust parameters and debug information
+
+**Note**: Multi-GPU systems may require using `--listgpus` and `-g` to select a compatible device.
+
+## Architecture
+
+### Core Systems
+- **Application Core** (`src/core/Application.cpp`): Main Vulkan application class inheriting from VulkanExampleBase
+- **Scene Management** (`src/scene/`): Hierarchical scene graph and object management
+- **UI System** (`src/ui/`): ImGui-based interface with real-time parameter adjustment
+- **Camera System** (`base/camera.hpp`): Advanced orbit camera with focus functionality
+- **Base Framework** (`base/`): Sascha Willems' Vulkan infrastructure
+
+### Vulkan Features
+- **Dynamic Rendering**: Uses VK_KHR_dynamic_rendering (no render passes/framebuffers)
+- **Modern API Usage**: Vulkan 1.3+ practices with timeline semaphores
+- **Multi-platform**: Window system integration for Windows, Linux, macOS
+- **Validation Support**: Comprehensive debugging with validation layers
+
+### Project Structure
+```
+├── src/ # Engine source code
+│ ├── core/ # Core application classes
+│ ├── scene/ # Scene management
+│ └── ui/ # ImGui interface
+├── base/ # Vulkan base framework
+├── shaders/glsl/ # GLSL shader sources
+├── assets/ # 3D models and textures
+└── build/ # Build output directory
+```
+
+## Camera System
+
+### F Key Focus Feature
+The camera system supports advanced focusing functionality:
+- **Press F**: Focus camera on selected object
+- **Automatic Distance**: Calculates optimal viewing distance
+- **Orbit Mode**: Mouse rotation orbits around focused object center
+- **Hybrid System**: Combines standard camera with orbit mode using `glm::lookAt()`
+
+### Implementation
+- `camera.focusOnObject()`: Sets orbit center and optimal distance
+- `camera.updateOrbitPosition()`: Handles spherical coordinate positioning
+- Seamless switching between standard and orbit modes
+
+## Development
+
+### Testing Changes
+```bash
+# Build and test
+cd build
+cmake --build . --config Release
+bin/Release/ProceduralEngine3D -v # Enable validation layers
+```
+
+### Debugging
+- Use `-v` flag for Vulkan validation layers
+- Check console output for debug information
+- Use `--listgpus` to verify device support
+- ImGui panels provide real-time debugging information
+
+### Adding Features
+- Follow Sascha Willems patterns for Vulkan code
+- Use dynamic rendering (no render passes required)
+- Implement proper buffer management and synchronization
+- Add ImGui panels for new feature parameters
+
+## Vulkan Examples
+
+This engine is built on top of Sascha Willems' comprehensive Vulkan examples. While the main engine focuses on procedural generation and scene management, the original examples remain available for learning Vulkan concepts.
+
+### Available Examples
+The `examples/` directory contains over 100 Vulkan examples covering:
+
+- **Basics**: Triangle rendering, pipelines, descriptor sets, textures
+- **Advanced Rendering**: Shadow mapping, deferred shading, PBR, ray tracing
+- **Compute Shaders**: GPU particles, N-body simulation, image processing
+- **Modern Features**: Dynamic rendering, mesh shaders, descriptor buffers
+- **Extensions**: Conservative rasterization, variable rate shading, timeline semaphores
+
+### Official Khronos Samples
+For the most up-to-date Vulkan learning resources, also check the official Khronos Vulkan Samples repository at: https://github.com/KhronosGroup/Vulkan-Samples
+
+### Building Individual Examples
+```bash
+# Build specific example (from build directory)
+cmake --build . --target triangle --config Release
+```
+
+For a complete reference of all available examples with detailed descriptions, see the original Sascha Willems Vulkan repository documentation. Each example demonstrates specific Vulkan concepts and can be built individually using the CMake targets.
## Credits and Attributions
See [CREDITS.md](CREDITS.md) for additional credits and attributions.
diff --git a/android/.gitignore b/android/.gitignore
deleted file mode 100644
index f3fc352a..00000000
--- a/android/.gitignore
+++ /dev/null
@@ -1,69 +0,0 @@
-# Built application files
-*.apk
-*.ap_
-
-# Files for the ART/Dalvik VM
-*.dex
-
-# Java class files
-*.class
-
-# Generated files
-bin/
-gen/
-out/
-
-# Gradle files
-.gradle/
-build/
-
-# Local configuration file (sdk path, etc)
-local.properties
-
-# Proguard folder generated by Eclipse
-proguard/
-
-# Log Files
-*.log
-
-# Android Studio Navigation editor temp files
-.navigation/
-
-# Android Studio captures folder
-captures/
-
-# IntelliJ
-*.iml
-.idea/workspace.xml
-.idea/tasks.xml
-.idea/gradle.xml
-.idea/assetWizardSettings.xml
-.idea/dictionaries
-.idea/libraries
-.idea/caches
-
-# Keystore files
-# Uncomment the following line if you do not want to check your keystore files in.
-#*.jks
-
-# External native build folder generated in Android Studio 2.2 and later
-.externalNativeBuild
-
-# Google Services (e.g. APIs or Firebase)
-google-services.json
-
-# Freeline
-freeline.py
-freeline/
-freeline_project_description.json
-
-# fastlane
-fastlane/report.xml
-fastlane/Preview.html
-fastlane/screenshots
-fastlane/test_output
-fastlane/readme.md
-
-**/assets/
-**/src/main/res/drawable/
-**/.cxx/
\ No newline at end of file
diff --git a/android/build.gradle b/android/build.gradle
deleted file mode 100644
index c774fed5..00000000
--- a/android/build.gradle
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright (C) 2016-2023 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-
-/** Top-level build file where you can add configuration options common to all sub-projects/modules */
-
-buildscript {
- repositories {
- google()
- mavenCentral()
- }
- dependencies {
- classpath 'com.android.tools.build:gradle:8.7.0'
- // NOTE: Do not place your application dependencies here; they belong
- // in the individual module build.gradle files
- }
-}
-
-allprojects {
- repositories {
- google()
- mavenCentral()
- }
- // This code is where all the magic happens and fixes the error.
- subprojects {
- afterEvaluate { project ->
- if (project.hasProperty('android')) {
- project.android {
- if (namespace == null) {
- namespace "de.saschawillems." + project.group
- }
- }
- }
- }
- }
-}
-
-ext {
- abiFilters = "arm64-v8a"
- minSdkVersion = 21
- targetSdkVersion = 26
- compileSdkVersion = 26
- shaderPath = '../../../shaders/'
- assetPath = '../../../assets/'
-}
\ No newline at end of file
diff --git a/android/common/res/drawable/icon.png b/android/common/res/drawable/icon.png
deleted file mode 100644
index 882f2a59..00000000
Binary files a/android/common/res/drawable/icon.png and /dev/null differ
diff --git a/android/examples/_template/CMakeLists.txt b/android/examples/_template/CMakeLists.txt
deleted file mode 100644
index 3411e789..00000000
--- a/android/examples/_template/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME %EXAMPLE_FOLDER%)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/_template/build.gradle b/android/examples/_template/build.gradle
deleted file mode 100644
index ff28692a..00000000
--- a/android/examples/_template/build.gradle
+++ /dev/null
@@ -1,54 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.%PACKAGE_NAME%"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
-%ASSET_COPY%
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/_template/src/main/AndroidManifest.xml b/android/examples/_template/src/main/AndroidManifest.xml
deleted file mode 100644
index d6b2ae8e..00000000
--- a/android/examples/_template/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/_template/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/_template/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/_template/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/base/CMakeLists.txt b/android/examples/base/CMakeLists.txt
deleted file mode 100644
index e564d522..00000000
--- a/android/examples/base/CMakeLists.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-file(GLOB BASE_SRC "../../../base/*.cpp" "../../../external/imgui/*.cpp")
-
-add_library(libbase SHARED ${BASE_SRC})
-
-include_directories(${BASE_DIR})
-include_directories(../../../external)
-include_directories(../../../external/glm)
-include_directories(../../../external/gli)
-include_directories(../../../external/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-set(KTX_DIR ../../../external/ktx)
-set(KTX_SOURCES
- ${KTX_DIR}/lib/texture.c
- ${KTX_DIR}/lib/hashlist.c
- ${KTX_DIR}/lib/checkheader.c
- ${KTX_DIR}/lib/swap.c
- ${KTX_DIR}/lib/memstream.c
- ${KTX_DIR}/lib/filestream.c
- ${KTX_DIR}/lib/vkloader.c
-)
-set(KTX_INCLUDE
- ${KTX_DIR}/include
- ${KTX_DIR}/lib
- ${KTX_DIR}/other_include
-)
-
-add_library(libktx ${KTX_SOURCES})
-target_include_directories(libktx PUBLIC ${KTX_INCLUDE})
-set_property(TARGET libktx PROPERTY FOLDER "external")
-
-
-target_link_libraries(
- libbase
- android
- log
- z
- libktx
-)
diff --git a/android/examples/bloom/CMakeLists.txt b/android/examples/bloom/CMakeLists.txt
deleted file mode 100644
index ac3ec0e5..00000000
--- a/android/examples/bloom/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME bloom)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/bloom/build.gradle b/android/examples/bloom/build.gradle
deleted file mode 100644
index 17ddb414..00000000
--- a/android/examples/bloom/build.gradle
+++ /dev/null
@@ -1,84 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanBloom"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath +'glsl/bloom'
- into 'assets/shaders/glsl/bloom'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath +'models'
- into 'assets/models'
- include 'retroufo.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath +'models'
- into 'assets/models'
- include 'retroufo_glow.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath +'models'
- into 'assets/models'
- include 'cube.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'cubemap_space.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/bloom/src/main/AndroidManifest.xml b/android/examples/bloom/src/main/AndroidManifest.xml
deleted file mode 100644
index 233f0056..00000000
--- a/android/examples/bloom/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/bloom/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/bloom/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/bloom/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/bufferdeviceaddress/CMakeLists.txt b/android/examples/bufferdeviceaddress/CMakeLists.txt
deleted file mode 100644
index 4f4a35e6..00000000
--- a/android/examples/bufferdeviceaddress/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME bufferdeviceaddress)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/bufferdeviceaddress/build.gradle b/android/examples/bufferdeviceaddress/build.gradle
deleted file mode 100644
index 9fe9a2af..00000000
--- a/android/examples/bufferdeviceaddress/build.gradle
+++ /dev/null
@@ -1,71 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanBufferDeviceAddress"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/bufferdeviceaddress'
- into 'assets/shaders/glsl/bufferdeviceaddress'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'cube.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'crate01_color_height_rgba.ktx'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/bufferdeviceaddress/src/main/AndroidManifest.xml b/android/examples/bufferdeviceaddress/src/main/AndroidManifest.xml
deleted file mode 100644
index cbc8668f..00000000
--- a/android/examples/bufferdeviceaddress/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/bufferdeviceaddress/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/bufferdeviceaddress/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/bufferdeviceaddress/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/computecloth/CMakeLists.txt b/android/examples/computecloth/CMakeLists.txt
deleted file mode 100644
index 0b801305..00000000
--- a/android/examples/computecloth/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME computecloth)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/computecloth/build.gradle b/android/examples/computecloth/build.gradle
deleted file mode 100644
index a51092fb..00000000
--- a/android/examples/computecloth/build.gradle
+++ /dev/null
@@ -1,72 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanComputecloth"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/computecloth'
- into 'assets/shaders/glsl/computecloth'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'sphere.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'vulkan_cloth_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/computecloth/src/main/AndroidManifest.xml b/android/examples/computecloth/src/main/AndroidManifest.xml
deleted file mode 100644
index 859de434..00000000
--- a/android/examples/computecloth/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/computecloth/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/computecloth/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/computecloth/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/computecullandlod/CMakeLists.txt b/android/examples/computecullandlod/CMakeLists.txt
deleted file mode 100644
index 1bdf0390..00000000
--- a/android/examples/computecullandlod/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME computecullandlod)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/computecullandlod/build.gradle b/android/examples/computecullandlod/build.gradle
deleted file mode 100644
index 173bb056..00000000
--- a/android/examples/computecullandlod/build.gradle
+++ /dev/null
@@ -1,66 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanComputecullandlod"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/computecullandlod'
- into 'assets/shaders/glsl/computecullandlod'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'suzanne_lods.gltf'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/computecullandlod/src/main/AndroidManifest.xml b/android/examples/computecullandlod/src/main/AndroidManifest.xml
deleted file mode 100644
index 9e85ce96..00000000
--- a/android/examples/computecullandlod/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/computecullandlod/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/computecullandlod/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/computecullandlod/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/computeheadless/CMakeLists.txt b/android/examples/computeheadless/CMakeLists.txt
deleted file mode 100644
index 4b88223b..00000000
--- a/android/examples/computeheadless/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME computeheadless)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/computeheadless/build.gradle b/android/examples/computeheadless/build.gradle
deleted file mode 100644
index 1c68bdcf..00000000
--- a/android/examples/computeheadless/build.gradle
+++ /dev/null
@@ -1,60 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanComputeheadless"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/computeheadless'
- into 'assets/shaders/glsl/computeheadless'
- include '*.*'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/computeheadless/src/main/AndroidManifest.xml b/android/examples/computeheadless/src/main/AndroidManifest.xml
deleted file mode 100644
index da1e42b2..00000000
--- a/android/examples/computeheadless/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/computeheadless/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/computeheadless/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/computeheadless/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/computenbody/CMakeLists.txt b/android/examples/computenbody/CMakeLists.txt
deleted file mode 100644
index a4898de9..00000000
--- a/android/examples/computenbody/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME computenbody)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/computenbody/build.gradle b/android/examples/computenbody/build.gradle
deleted file mode 100644
index 73ec7863..00000000
--- a/android/examples/computenbody/build.gradle
+++ /dev/null
@@ -1,72 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanComputenbody"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/computenbody'
- into 'assets/shaders/glsl/computenbody'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'particle01_rgba.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'particle_gradient_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/computenbody/src/main/AndroidManifest.xml b/android/examples/computenbody/src/main/AndroidManifest.xml
deleted file mode 100644
index ccc07122..00000000
--- a/android/examples/computenbody/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/computenbody/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/computenbody/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/computenbody/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/computeparticles/CMakeLists.txt b/android/examples/computeparticles/CMakeLists.txt
deleted file mode 100644
index 0a0255ff..00000000
--- a/android/examples/computeparticles/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME computeparticles)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/computeparticles/build.gradle b/android/examples/computeparticles/build.gradle
deleted file mode 100644
index 58d054a7..00000000
--- a/android/examples/computeparticles/build.gradle
+++ /dev/null
@@ -1,72 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanComputeparticles"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/computeparticles'
- into 'assets/shaders/glsl/computeparticles'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'particle01_rgba.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'particle_gradient_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/computeparticles/src/main/AndroidManifest.xml b/android/examples/computeparticles/src/main/AndroidManifest.xml
deleted file mode 100644
index e7614e10..00000000
--- a/android/examples/computeparticles/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/computeparticles/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/computeparticles/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/computeparticles/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/computeraytracing/CMakeLists.txt b/android/examples/computeraytracing/CMakeLists.txt
deleted file mode 100644
index 801d15dd..00000000
--- a/android/examples/computeraytracing/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME computeraytracing)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/computeraytracing/build.gradle b/android/examples/computeraytracing/build.gradle
deleted file mode 100644
index dd75ddc7..00000000
--- a/android/examples/computeraytracing/build.gradle
+++ /dev/null
@@ -1,60 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanComputeRaytracing"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/computeraytracing'
- into 'assets/shaders/glsl/computeraytracing'
- include '*.*'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/computeraytracing/src/main/AndroidManifest.xml b/android/examples/computeraytracing/src/main/AndroidManifest.xml
deleted file mode 100644
index 9286fa3d..00000000
--- a/android/examples/computeraytracing/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/computeraytracing/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/computeraytracing/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/computeraytracing/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/computeshader/CMakeLists.txt b/android/examples/computeshader/CMakeLists.txt
deleted file mode 100644
index 688dd589..00000000
--- a/android/examples/computeshader/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME computeshader)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/computeshader/build.gradle b/android/examples/computeshader/build.gradle
deleted file mode 100644
index 4fe97915..00000000
--- a/android/examples/computeshader/build.gradle
+++ /dev/null
@@ -1,66 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanComputeshader"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/computeshader'
- into 'assets/shaders/glsl/computeshader'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'vulkan_11_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/computeshader/src/main/AndroidManifest.xml b/android/examples/computeshader/src/main/AndroidManifest.xml
deleted file mode 100644
index dbb77b9f..00000000
--- a/android/examples/computeshader/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/computeshader/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/computeshader/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/computeshader/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/conditionalrender/CMakeLists.txt b/android/examples/conditionalrender/CMakeLists.txt
deleted file mode 100644
index bca54576..00000000
--- a/android/examples/conditionalrender/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME conditionalrender)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/conditionalrender/build.gradle b/android/examples/conditionalrender/build.gradle
deleted file mode 100644
index 725a46f6..00000000
--- a/android/examples/conditionalrender/build.gradle
+++ /dev/null
@@ -1,64 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanConditionalrender"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/conditionalrender'
- into 'assets/shaders/glsl/conditionalrender'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models/gltf/glTF-Embedded'
- into 'assets/models/gltf/glTF-Embedded'
- include 'Buggy.gltf'
- }
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/conditionalrender/src/main/AndroidManifest.xml b/android/examples/conditionalrender/src/main/AndroidManifest.xml
deleted file mode 100644
index 3ab90a77..00000000
--- a/android/examples/conditionalrender/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/conditionalrender/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/conditionalrender/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/conditionalrender/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/conservativeraster/CMakeLists.txt b/android/examples/conservativeraster/CMakeLists.txt
deleted file mode 100644
index 70705814..00000000
--- a/android/examples/conservativeraster/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME conservativeraster)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/conservativeraster/build.gradle b/android/examples/conservativeraster/build.gradle
deleted file mode 100644
index b7abf2af..00000000
--- a/android/examples/conservativeraster/build.gradle
+++ /dev/null
@@ -1,60 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanConservativeraster"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/conservativeraster'
- into 'assets/shaders/glsl/conservativeraster'
- include '*.*'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/conservativeraster/src/main/AndroidManifest.xml b/android/examples/conservativeraster/src/main/AndroidManifest.xml
deleted file mode 100644
index e9daac07..00000000
--- a/android/examples/conservativeraster/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/conservativeraster/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/conservativeraster/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/conservativeraster/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/debugprintf/CMakeLists.txt b/android/examples/debugprintf/CMakeLists.txt
deleted file mode 100644
index 5ce8a32e..00000000
--- a/android/examples/debugprintf/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME debugprintf)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/debugprintf/build.gradle b/android/examples/debugprintf/build.gradle
deleted file mode 100644
index 9a98a61c..00000000
--- a/android/examples/debugprintf/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanDebugprintf"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/debugprintf'
- into 'assets/shaders/glsl/debugprintf'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'treasure_smooth.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/debugprintf/src/main/AndroidManifest.xml b/android/examples/debugprintf/src/main/AndroidManifest.xml
deleted file mode 100644
index bfb99c12..00000000
--- a/android/examples/debugprintf/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/debugprintf/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/debugprintf/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/debugprintf/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/debugutils/CMakeLists.txt b/android/examples/debugutils/CMakeLists.txt
deleted file mode 100644
index 48ba3a6f..00000000
--- a/android/examples/debugutils/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME debugutils)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/debugutils/build.gradle b/android/examples/debugutils/build.gradle
deleted file mode 100644
index b2a29b0a..00000000
--- a/android/examples/debugutils/build.gradle
+++ /dev/null
@@ -1,72 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanDebugutils"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/debugutils'
- into 'assets/shaders/glsl/debugutils'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'treasure_smooth.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'treasure_glow.gltf'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/debugutils/src/main/AndroidManifest.xml b/android/examples/debugutils/src/main/AndroidManifest.xml
deleted file mode 100644
index cdd22d06..00000000
--- a/android/examples/debugutils/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/debugutils/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/debugutils/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/debugutils/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/deferred/CMakeLists.txt b/android/examples/deferred/CMakeLists.txt
deleted file mode 100644
index 2f9aa0ff..00000000
--- a/android/examples/deferred/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME deferred)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/deferred/build.gradle b/android/examples/deferred/build.gradle
deleted file mode 100644
index 46226069..00000000
--- a/android/examples/deferred/build.gradle
+++ /dev/null
@@ -1,84 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanDeferred"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/deferred'
- into 'assets/shaders/glsl/deferred'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'deferred_floor.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'stonefloor01_color_*.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'stonefloor01_normal_*.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models/armor'
- into 'assets/models/armor'
- include '*.*'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/deferred/src/main/AndroidManifest.xml b/android/examples/deferred/src/main/AndroidManifest.xml
deleted file mode 100644
index b1838c4a..00000000
--- a/android/examples/deferred/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/deferred/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/deferred/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/deferred/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/deferredmultisampling/CMakeLists.txt b/android/examples/deferredmultisampling/CMakeLists.txt
deleted file mode 100644
index 9c01e50f..00000000
--- a/android/examples/deferredmultisampling/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME deferredmultisampling)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/deferredmultisampling/build.gradle b/android/examples/deferredmultisampling/build.gradle
deleted file mode 100644
index 4d08713e..00000000
--- a/android/examples/deferredmultisampling/build.gradle
+++ /dev/null
@@ -1,84 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanDeferredmultisampling"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/deferredmultisampling'
- into 'assets/shaders/glsl/deferredmultisampling'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'deferred_box.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'stonefloor02_color_*.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'stonefloor02_normal_*.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models/armor'
- into 'assets/models/armor'
- include '*.*'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/deferredmultisampling/src/main/AndroidManifest.xml b/android/examples/deferredmultisampling/src/main/AndroidManifest.xml
deleted file mode 100644
index 49426468..00000000
--- a/android/examples/deferredmultisampling/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/deferredmultisampling/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/deferredmultisampling/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/deferredmultisampling/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/deferredshadows/CMakeLists.txt b/android/examples/deferredshadows/CMakeLists.txt
deleted file mode 100644
index 8523380e..00000000
--- a/android/examples/deferredshadows/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME deferredshadows)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/deferredshadows/build.gradle b/android/examples/deferredshadows/build.gradle
deleted file mode 100644
index 76ad5f81..00000000
--- a/android/examples/deferredshadows/build.gradle
+++ /dev/null
@@ -1,84 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanDeferredshadows"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/deferredshadows'
- into 'assets/shaders/glsl/deferredshadows'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'deferred_box.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'stonefloor02_color_*.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'stonefloor02_normal_*.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models/armor'
- into 'assets/models/armor'
- include '*.*'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/deferredshadows/src/main/AndroidManifest.xml b/android/examples/deferredshadows/src/main/AndroidManifest.xml
deleted file mode 100644
index cdb0a40f..00000000
--- a/android/examples/deferredshadows/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/deferredshadows/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/deferredshadows/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/deferredshadows/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/descriptorbuffer/CMakeLists.txt b/android/examples/descriptorbuffer/CMakeLists.txt
deleted file mode 100644
index 8b1f3694..00000000
--- a/android/examples/descriptorbuffer/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME descriptorbuffer)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/descriptorbuffer/build.gradle b/android/examples/descriptorbuffer/build.gradle
deleted file mode 100644
index 54ae5720..00000000
--- a/android/examples/descriptorbuffer/build.gradle
+++ /dev/null
@@ -1,72 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanDescriptorbuffer"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/descriptorbuffer'
- into 'assets/shaders/glsl/descriptorbuffer'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'cube.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'crate01_color_height_rgba.gltf'
- include 'crate02_color_height_rgba.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/descriptorbuffer/src/main/AndroidManifest.xml b/android/examples/descriptorbuffer/src/main/AndroidManifest.xml
deleted file mode 100644
index 7f1039fb..00000000
--- a/android/examples/descriptorbuffer/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/descriptorbuffer/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/descriptorbuffer/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/descriptorbuffer/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/descriptorindexing/CMakeLists.txt b/android/examples/descriptorindexing/CMakeLists.txt
deleted file mode 100644
index 69a813ea..00000000
--- a/android/examples/descriptorindexing/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME descriptorindexing)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/descriptorindexing/build.gradle b/android/examples/descriptorindexing/build.gradle
deleted file mode 100644
index a56ebce4..00000000
--- a/android/examples/descriptorindexing/build.gradle
+++ /dev/null
@@ -1,58 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanDescriptorindexing"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/descriptorindexing'
- into 'assets/shaders/glsl/descriptorindexing'
- include '*.*'
- }
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/descriptorindexing/src/main/AndroidManifest.xml b/android/examples/descriptorindexing/src/main/AndroidManifest.xml
deleted file mode 100644
index a85c1566..00000000
--- a/android/examples/descriptorindexing/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/descriptorindexing/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/descriptorindexing/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/descriptorindexing/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/descriptorsets/CMakeLists.txt b/android/examples/descriptorsets/CMakeLists.txt
deleted file mode 100644
index 639667ea..00000000
--- a/android/examples/descriptorsets/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME descriptorsets)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/descriptorsets/build.gradle b/android/examples/descriptorsets/build.gradle
deleted file mode 100644
index 7ea2181b..00000000
--- a/android/examples/descriptorsets/build.gradle
+++ /dev/null
@@ -1,78 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanDescriptorsets"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/descriptorsets'
- into 'assets/shaders/glsl/descriptorsets'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'cube.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'crate01_color_height_rgba.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'crate02_color_height_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/descriptorsets/src/main/AndroidManifest.xml b/android/examples/descriptorsets/src/main/AndroidManifest.xml
deleted file mode 100644
index 0dac572e..00000000
--- a/android/examples/descriptorsets/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/descriptorsets/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/descriptorsets/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/descriptorsets/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/displacement/CMakeLists.txt b/android/examples/displacement/CMakeLists.txt
deleted file mode 100644
index 300c9dd4..00000000
--- a/android/examples/displacement/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME displacement)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/displacement/build.gradle b/android/examples/displacement/build.gradle
deleted file mode 100644
index 0cd19008..00000000
--- a/android/examples/displacement/build.gradle
+++ /dev/null
@@ -1,72 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanDisplacement"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/displacement'
- into 'assets/shaders/glsl/displacement'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'displacement_plane.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'stonefloor03_color_height_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/displacement/src/main/AndroidManifest.xml b/android/examples/displacement/src/main/AndroidManifest.xml
deleted file mode 100644
index 3b6ca22b..00000000
--- a/android/examples/displacement/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/displacement/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/displacement/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/displacement/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/distancefieldfonts/CMakeLists.txt b/android/examples/distancefieldfonts/CMakeLists.txt
deleted file mode 100644
index 7694a122..00000000
--- a/android/examples/distancefieldfonts/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME distancefieldfonts)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/distancefieldfonts/build.gradle b/android/examples/distancefieldfonts/build.gradle
deleted file mode 100644
index 8dc4bb04..00000000
--- a/android/examples/distancefieldfonts/build.gradle
+++ /dev/null
@@ -1,78 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanDistancefieldfonts"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/distancefieldfonts'
- into 'assets/shaders/glsl/distancefieldfonts'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'font_sdf_rgba.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'font_bitmap_rgba.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + './'
- into 'assets/./'
- include 'font.fnt'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/distancefieldfonts/src/main/AndroidManifest.xml b/android/examples/distancefieldfonts/src/main/AndroidManifest.xml
deleted file mode 100644
index 2a844fd4..00000000
--- a/android/examples/distancefieldfonts/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/distancefieldfonts/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/distancefieldfonts/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/distancefieldfonts/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/dynamicrendering/CMakeLists.txt b/android/examples/dynamicrendering/CMakeLists.txt
deleted file mode 100644
index 0611870c..00000000
--- a/android/examples/dynamicrendering/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME dynamicrendering)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/dynamicrendering/build.gradle b/android/examples/dynamicrendering/build.gradle
deleted file mode 100644
index 70825b84..00000000
--- a/android/examples/dynamicrendering/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanDynamicrendering"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/dynamicrendering'
- into 'assets/shaders/glsl/dynamicrendering'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'voyager.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/dynamicrendering/src/main/AndroidManifest.xml b/android/examples/dynamicrendering/src/main/AndroidManifest.xml
deleted file mode 100644
index d6c17910..00000000
--- a/android/examples/dynamicrendering/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/dynamicrendering/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/dynamicrendering/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/dynamicrendering/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/dynamicrenderingmultisampling/CMakeLists.txt b/android/examples/dynamicrenderingmultisampling/CMakeLists.txt
deleted file mode 100644
index 256b5b4f..00000000
--- a/android/examples/dynamicrenderingmultisampling/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME dynamicrenderingmultisampling)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/dynamicrenderingmultisampling/build.gradle b/android/examples/dynamicrenderingmultisampling/build.gradle
deleted file mode 100644
index de7f4824..00000000
--- a/android/examples/dynamicrenderingmultisampling/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanDynamicrenderingmulitsampling"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/dynamicrendering'
- into 'assets/shaders/glsl/dynamicrendering'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'voyager.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/dynamicrenderingmultisampling/src/main/AndroidManifest.xml b/android/examples/dynamicrenderingmultisampling/src/main/AndroidManifest.xml
deleted file mode 100644
index ccefddb6..00000000
--- a/android/examples/dynamicrenderingmultisampling/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/dynamicrenderingmultisampling/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/dynamicrenderingmultisampling/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/dynamicrenderingmultisampling/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/dynamicstate/CMakeLists.txt b/android/examples/dynamicstate/CMakeLists.txt
deleted file mode 100644
index 67dfc8b7..00000000
--- a/android/examples/dynamicstate/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME dynamicstate)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/dynamicstate/build.gradle b/android/examples/dynamicstate/build.gradle
deleted file mode 100644
index eef78dc5..00000000
--- a/android/examples/dynamicstate/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanDynamicstate"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/pipelines'
- into 'assets/shaders/glsl/pipelines'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'treasure_smooth.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/dynamicstate/src/main/AndroidManifest.xml b/android/examples/dynamicstate/src/main/AndroidManifest.xml
deleted file mode 100644
index b1798ce7..00000000
--- a/android/examples/dynamicstate/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/dynamicstate/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/dynamicstate/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/dynamicstate/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/dynamicuniformbuffer/CMakeLists.txt b/android/examples/dynamicuniformbuffer/CMakeLists.txt
deleted file mode 100644
index 80540406..00000000
--- a/android/examples/dynamicuniformbuffer/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME dynamicuniformbuffer)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/dynamicuniformbuffer/build.gradle b/android/examples/dynamicuniformbuffer/build.gradle
deleted file mode 100644
index c743d4bb..00000000
--- a/android/examples/dynamicuniformbuffer/build.gradle
+++ /dev/null
@@ -1,60 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanDynamicuniformbuffer"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/dynamicuniformbuffer'
- into 'assets/shaders/glsl/dynamicuniformbuffer'
- include '*.*'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/dynamicuniformbuffer/src/main/AndroidManifest.xml b/android/examples/dynamicuniformbuffer/src/main/AndroidManifest.xml
deleted file mode 100644
index 171ffc86..00000000
--- a/android/examples/dynamicuniformbuffer/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/dynamicuniformbuffer/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/dynamicuniformbuffer/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/dynamicuniformbuffer/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/gears/CMakeLists.txt b/android/examples/gears/CMakeLists.txt
deleted file mode 100644
index c91b527a..00000000
--- a/android/examples/gears/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME gears)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/gears/build.gradle b/android/examples/gears/build.gradle
deleted file mode 100644
index 770a11d1..00000000
--- a/android/examples/gears/build.gradle
+++ /dev/null
@@ -1,60 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanGears"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/gears'
- into 'assets/shaders/glsl/gears'
- include '*.*'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/gears/src/main/AndroidManifest.xml b/android/examples/gears/src/main/AndroidManifest.xml
deleted file mode 100644
index da134b43..00000000
--- a/android/examples/gears/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/gears/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/gears/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/gears/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/geometryshader/CMakeLists.txt b/android/examples/geometryshader/CMakeLists.txt
deleted file mode 100644
index a743e06a..00000000
--- a/android/examples/geometryshader/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME geometryshader)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/geometryshader/build.gradle b/android/examples/geometryshader/build.gradle
deleted file mode 100644
index bddb5ab8..00000000
--- a/android/examples/geometryshader/build.gradle
+++ /dev/null
@@ -1,66 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanGeometryshader"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/geometryshader'
- into 'assets/shaders/glsl/geometryshader'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'suzanne.gltf'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/geometryshader/src/main/AndroidManifest.xml b/android/examples/geometryshader/src/main/AndroidManifest.xml
deleted file mode 100644
index dfbfd2ca..00000000
--- a/android/examples/geometryshader/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/geometryshader/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/geometryshader/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/geometryshader/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/gltfloading/CMakeLists.txt b/android/examples/gltfloading/CMakeLists.txt
deleted file mode 100644
index 47229876..00000000
--- a/android/examples/gltfloading/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME gltfloading)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/gltfloading/build.gradle b/android/examples/gltfloading/build.gradle
deleted file mode 100644
index d8327e82..00000000
--- a/android/examples/gltfloading/build.gradle
+++ /dev/null
@@ -1,66 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanglTFScene"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/gltfloading'
- into 'assets/shaders/glsl/gltfloading'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models/FlightHelmet/glTF'
- into 'assets/models/FlightHelmet/glTF'
- include '*.*'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/gltfloading/src/main/AndroidManifest.xml b/android/examples/gltfloading/src/main/AndroidManifest.xml
deleted file mode 100644
index 090e46c7..00000000
--- a/android/examples/gltfloading/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/gltfloading/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/gltfloading/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/gltfloading/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/gltfscenerendering/CMakeLists.txt b/android/examples/gltfscenerendering/CMakeLists.txt
deleted file mode 100644
index e73fa443..00000000
--- a/android/examples/gltfscenerendering/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME gltfscenerendering)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/gltfscenerendering/build.gradle b/android/examples/gltfscenerendering/build.gradle
deleted file mode 100644
index 34660ebc..00000000
--- a/android/examples/gltfscenerendering/build.gradle
+++ /dev/null
@@ -1,66 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanScenerendering"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath +'glsl/gltfscenerendering'
- into 'assets/shaders/glsl/gltfscenerendering'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models/sponza'
- into 'assets/models/sponza'
- include '*.*'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/gltfscenerendering/src/main/AndroidManifest.xml b/android/examples/gltfscenerendering/src/main/AndroidManifest.xml
deleted file mode 100644
index 6ce148be..00000000
--- a/android/examples/gltfscenerendering/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/gltfscenerendering/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/gltfscenerendering/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/gltfscenerendering/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/gltfskinning/CMakeLists.txt b/android/examples/gltfskinning/CMakeLists.txt
deleted file mode 100644
index 32e4f6b1..00000000
--- a/android/examples/gltfskinning/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME gltfskinning)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/gltfskinning/build.gradle b/android/examples/gltfskinning/build.gradle
deleted file mode 100644
index 001d53b6..00000000
--- a/android/examples/gltfskinning/build.gradle
+++ /dev/null
@@ -1,66 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanglTFSkinning"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into "assets/shaders/glsl/base"
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/gltfskinning'
- into 'assets/shaders/glsl/gltfskinning'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models/CesiumMan/glTF'
- into 'assets/models/CesiumMan/glTF'
- include '*.*'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/gltfskinning/src/main/AndroidManifest.xml b/android/examples/gltfskinning/src/main/AndroidManifest.xml
deleted file mode 100644
index a9d112f1..00000000
--- a/android/examples/gltfskinning/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/gltfskinning/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/gltfskinning/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/gltfskinning/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/gradle/outputfilename.gradle b/android/examples/gradle/outputfilename.gradle
deleted file mode 100644
index e71624b3..00000000
--- a/android/examples/gradle/outputfilename.gradle
+++ /dev/null
@@ -1,7 +0,0 @@
-android {
- applicationVariants.all { variant ->
- variant.outputs.all {
- outputFileName = "../../../../../bin/" + outputFileName
- }
- }
-}
\ No newline at end of file
diff --git a/android/examples/graphicspipelinelibrary/CMakeLists.txt b/android/examples/graphicspipelinelibrary/CMakeLists.txt
deleted file mode 100644
index d789ea68..00000000
--- a/android/examples/graphicspipelinelibrary/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME graphicspipelinelibrary)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/graphicspipelinelibrary/build.gradle b/android/examples/graphicspipelinelibrary/build.gradle
deleted file mode 100644
index 71c17e81..00000000
--- a/android/examples/graphicspipelinelibrary/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanGraphicspipelinelibrary"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/graphicspipelinelibrary'
- into 'assets/shaders/glsl/graphicspipelinelibrary'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'color_teapot_spheres.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/graphicspipelinelibrary/src/main/AndroidManifest.xml b/android/examples/graphicspipelinelibrary/src/main/AndroidManifest.xml
deleted file mode 100644
index 3a2b38ab..00000000
--- a/android/examples/graphicspipelinelibrary/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/graphicspipelinelibrary/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/graphicspipelinelibrary/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/graphicspipelinelibrary/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/hdr/CMakeLists.txt b/android/examples/hdr/CMakeLists.txt
deleted file mode 100644
index 6e84bcef..00000000
--- a/android/examples/hdr/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME hdr)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/hdr/build.gradle b/android/examples/hdr/build.gradle
deleted file mode 100644
index 76404a06..00000000
--- a/android/examples/hdr/build.gradle
+++ /dev/null
@@ -1,96 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanHDR"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/hdr'
- into 'assets/shaders/glsl/hdr'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'cube.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'sphere.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'teapot.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'torusknot.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'venus.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures/hdr'
- into 'assets/textures/hdr'
- include 'uffizi_cube.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/hdr/src/main/AndroidManifest.xml b/android/examples/hdr/src/main/AndroidManifest.xml
deleted file mode 100644
index f2604321..00000000
--- a/android/examples/hdr/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/hdr/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/hdr/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/hdr/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/hostimagecopy/CMakeLists.txt b/android/examples/hostimagecopy/CMakeLists.txt
deleted file mode 100644
index cdee596e..00000000
--- a/android/examples/hostimagecopy/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME hostimagecopy)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/hostimagecopy/build.gradle b/android/examples/hostimagecopy/build.gradle
deleted file mode 100644
index e59aba39..00000000
--- a/android/examples/hostimagecopy/build.gradle
+++ /dev/null
@@ -1,71 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanHostImageCopy"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/texture'
- into 'assets/shaders/glsl/texture'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'metalplate01_rgba.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'plane_z.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/hostimagecopy/src/main/AndroidManifest.xml b/android/examples/hostimagecopy/src/main/AndroidManifest.xml
deleted file mode 100644
index fcd8d7c5..00000000
--- a/android/examples/hostimagecopy/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/hostimagecopy/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/hostimagecopy/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/hostimagecopy/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/imgui/CMakeLists.txt b/android/examples/imgui/CMakeLists.txt
deleted file mode 100644
index 6ee5d400..00000000
--- a/android/examples/imgui/CMakeLists.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME imgui)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-file(GLOB ADD_SOURCE "${EXTERNAL_DIR}/imgui/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC} ${ADD_SOURCE})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/imgui/build.gradle b/android/examples/imgui/build.gradle
deleted file mode 100644
index 8e46075f..00000000
--- a/android/examples/imgui/build.gradle
+++ /dev/null
@@ -1,78 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanImGui"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/imgui'
- into 'assets/shaders/glsl/imgui'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'vulkanscenemodels.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'vulkanscenebackground.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'vulkanscenelogos.gltf'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/imgui/src/main/AndroidManifest.xml b/android/examples/imgui/src/main/AndroidManifest.xml
deleted file mode 100644
index 1b4f2ed1..00000000
--- a/android/examples/imgui/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/imgui/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/imgui/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/imgui/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/indirectdraw/CMakeLists.txt b/android/examples/indirectdraw/CMakeLists.txt
deleted file mode 100644
index 5480399b..00000000
--- a/android/examples/indirectdraw/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME indirectdraw)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/indirectdraw/build.gradle b/android/examples/indirectdraw/build.gradle
deleted file mode 100644
index e21c98dd..00000000
--- a/android/examples/indirectdraw/build.gradle
+++ /dev/null
@@ -1,90 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanIndirectdraw"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/indirectdraw'
- into 'assets/shaders/glsl/indirectdraw'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'plants.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'plane_circle.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'sphere.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'texturearray_plants_rgba.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'ground_dry_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/indirectdraw/src/main/AndroidManifest.xml b/android/examples/indirectdraw/src/main/AndroidManifest.xml
deleted file mode 100644
index 60fa8e14..00000000
--- a/android/examples/indirectdraw/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/indirectdraw/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/indirectdraw/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/indirectdraw/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/inlineuniformblocks/CMakeLists.txt b/android/examples/inlineuniformblocks/CMakeLists.txt
deleted file mode 100644
index 276636c6..00000000
--- a/android/examples/inlineuniformblocks/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME inlineuniformblocks)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/inlineuniformblocks/build.gradle b/android/examples/inlineuniformblocks/build.gradle
deleted file mode 100644
index 0892b747..00000000
--- a/android/examples/inlineuniformblocks/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanInlineuniformblocks"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/inlineuniformblocks'
- into 'assets/shaders/glsl/inlineuniformblocks'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'sphere.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/inlineuniformblocks/src/main/AndroidManifest.xml b/android/examples/inlineuniformblocks/src/main/AndroidManifest.xml
deleted file mode 100644
index e9745391..00000000
--- a/android/examples/inlineuniformblocks/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/inlineuniformblocks/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/inlineuniformblocks/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/inlineuniformblocks/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/inputattachments/CMakeLists.txt b/android/examples/inputattachments/CMakeLists.txt
deleted file mode 100644
index d07704e2..00000000
--- a/android/examples/inputattachments/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME inputattachments)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/inputattachments/build.gradle b/android/examples/inputattachments/build.gradle
deleted file mode 100644
index 9dace85d..00000000
--- a/android/examples/inputattachments/build.gradle
+++ /dev/null
@@ -1,70 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanInputattachments"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- main {
- jniLibs {
- srcDir "${android.ndkDirectory}/sources/third_party/vulkan/src/build-android/jniLibs"
- }
- }
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/inputattachments'
- into 'assets/shaders/glsl/inputattachments'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'treasure_smooth.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/inputattachments/src/main/AndroidManifest.xml b/android/examples/inputattachments/src/main/AndroidManifest.xml
deleted file mode 100644
index 0cfc68ca..00000000
--- a/android/examples/inputattachments/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/inputattachments/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/inputattachments/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/inputattachments/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/instancing/CMakeLists.txt b/android/examples/instancing/CMakeLists.txt
deleted file mode 100644
index 0949f09c..00000000
--- a/android/examples/instancing/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME instancing)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/instancing/build.gradle b/android/examples/instancing/build.gradle
deleted file mode 100644
index 597f79c0..00000000
--- a/android/examples/instancing/build.gradle
+++ /dev/null
@@ -1,84 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanInstancing"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/instancing'
- into 'assets/shaders/glsl/instancing'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'rock01.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'lavaplanet.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'texturearray_rocks*.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'lavaplanet*.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/instancing/src/main/AndroidManifest.xml b/android/examples/instancing/src/main/AndroidManifest.xml
deleted file mode 100644
index 6a134704..00000000
--- a/android/examples/instancing/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/instancing/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/instancing/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/instancing/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/meshshader/CMakeLists.txt b/android/examples/meshshader/CMakeLists.txt
deleted file mode 100644
index f6f0f28d..00000000
--- a/android/examples/meshshader/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME meshshader)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/meshshader/build.gradle b/android/examples/meshshader/build.gradle
deleted file mode 100644
index 81e112cd..00000000
--- a/android/examples/meshshader/build.gradle
+++ /dev/null
@@ -1,59 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanMeshshader"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/meshshader'
- into 'assets/shaders/glsl/meshshader'
- include '*.*'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/meshshader/src/main/AndroidManifest.xml b/android/examples/meshshader/src/main/AndroidManifest.xml
deleted file mode 100644
index 89ad0f7a..00000000
--- a/android/examples/meshshader/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/meshshader/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/meshshader/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/meshshader/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/multisampling/CMakeLists.txt b/android/examples/multisampling/CMakeLists.txt
deleted file mode 100644
index 7dd374c7..00000000
--- a/android/examples/multisampling/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME multisampling)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/multisampling/build.gradle b/android/examples/multisampling/build.gradle
deleted file mode 100644
index c0c620bb..00000000
--- a/android/examples/multisampling/build.gradle
+++ /dev/null
@@ -1,66 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanMultisampling"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/multisampling'
- into 'assets/shaders/glsl/multisampling'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'voyager.gltf'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/multisampling/src/main/AndroidManifest.xml b/android/examples/multisampling/src/main/AndroidManifest.xml
deleted file mode 100644
index aa113840..00000000
--- a/android/examples/multisampling/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/multisampling/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/multisampling/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/multisampling/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/multithreading/CMakeLists.txt b/android/examples/multithreading/CMakeLists.txt
deleted file mode 100644
index e7e07b83..00000000
--- a/android/examples/multithreading/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME multithreading)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/multithreading/build.gradle b/android/examples/multithreading/build.gradle
deleted file mode 100644
index fbd26b6c..00000000
--- a/android/examples/multithreading/build.gradle
+++ /dev/null
@@ -1,72 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanMultithreading"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/multithreading'
- into 'assets/shaders/glsl/multithreading'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'retroufo_red_lowpoly.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'sphere.gltf'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/multithreading/src/main/AndroidManifest.xml b/android/examples/multithreading/src/main/AndroidManifest.xml
deleted file mode 100644
index f002469a..00000000
--- a/android/examples/multithreading/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/multithreading/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/multithreading/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/multithreading/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/multiview/CMakeLists.txt b/android/examples/multiview/CMakeLists.txt
deleted file mode 100644
index 5280226c..00000000
--- a/android/examples/multiview/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME multiview)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/multiview/build.gradle b/android/examples/multiview/build.gradle
deleted file mode 100644
index d2acf842..00000000
--- a/android/examples/multiview/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanMultiview"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/multiview'
- into 'assets/shaders/glsl/multiview'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'sampleroom.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/multiview/src/main/AndroidManifest.xml b/android/examples/multiview/src/main/AndroidManifest.xml
deleted file mode 100644
index 274906e2..00000000
--- a/android/examples/multiview/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/multiview/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/multiview/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/multiview/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/negativeviewportheight/CMakeLists.txt b/android/examples/negativeviewportheight/CMakeLists.txt
deleted file mode 100644
index 9554a347..00000000
--- a/android/examples/negativeviewportheight/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME negativeviewportheight)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/negativeviewportheight/build.gradle b/android/examples/negativeviewportheight/build.gradle
deleted file mode 100644
index 85b9642c..00000000
--- a/android/examples/negativeviewportheight/build.gradle
+++ /dev/null
@@ -1,72 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanNegativeviewportheight"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/negativeviewportheight'
- into 'assets/shaders/glsl/negativeviewportheight'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'texture_orientation_ccw_rgba.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'texture_orientation_cw_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/negativeviewportheight/src/main/AndroidManifest.xml b/android/examples/negativeviewportheight/src/main/AndroidManifest.xml
deleted file mode 100644
index 3455af63..00000000
--- a/android/examples/negativeviewportheight/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/negativeviewportheight/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/negativeviewportheight/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/negativeviewportheight/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/occlusionquery/CMakeLists.txt b/android/examples/occlusionquery/CMakeLists.txt
deleted file mode 100644
index b33dbdcb..00000000
--- a/android/examples/occlusionquery/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME occlusionquery)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/occlusionquery/build.gradle b/android/examples/occlusionquery/build.gradle
deleted file mode 100644
index 9eaa7e0c..00000000
--- a/android/examples/occlusionquery/build.gradle
+++ /dev/null
@@ -1,78 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanOcclusionquery"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/occlusionquery'
- into 'assets/shaders/glsl/occlusionquery'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'plane_z.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'teapot.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'sphere.gltf'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/occlusionquery/src/main/AndroidManifest.xml b/android/examples/occlusionquery/src/main/AndroidManifest.xml
deleted file mode 100644
index ab7386b9..00000000
--- a/android/examples/occlusionquery/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/occlusionquery/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/occlusionquery/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/occlusionquery/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/offscreen/CMakeLists.txt b/android/examples/offscreen/CMakeLists.txt
deleted file mode 100644
index 35f62af4..00000000
--- a/android/examples/offscreen/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME offscreen)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/offscreen/build.gradle b/android/examples/offscreen/build.gradle
deleted file mode 100644
index 9b700c7c..00000000
--- a/android/examples/offscreen/build.gradle
+++ /dev/null
@@ -1,71 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanOffscreen"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/offscreen'
- into 'assets/shaders/glsl/offscreen'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'plane.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'chinesedragon.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/offscreen/src/main/AndroidManifest.xml b/android/examples/offscreen/src/main/AndroidManifest.xml
deleted file mode 100644
index 97f3ce24..00000000
--- a/android/examples/offscreen/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/offscreen/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/offscreen/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/offscreen/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/oit/CMakeLists.txt b/android/examples/oit/CMakeLists.txt
deleted file mode 100644
index 86202e17..00000000
--- a/android/examples/oit/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME oit)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/oit/build.gradle b/android/examples/oit/build.gradle
deleted file mode 100644
index 28922c1d..00000000
--- a/android/examples/oit/build.gradle
+++ /dev/null
@@ -1,71 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanOrderIndependentTransparency"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/oit'
- into 'assets/shaders/glsl/oit'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'sphere.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'cube.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/oit/src/main/AndroidManifest.xml b/android/examples/oit/src/main/AndroidManifest.xml
deleted file mode 100644
index 994c2877..00000000
--- a/android/examples/oit/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/oit/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/oit/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/oit/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/parallaxmapping/CMakeLists.txt b/android/examples/parallaxmapping/CMakeLists.txt
deleted file mode 100644
index a3204944..00000000
--- a/android/examples/parallaxmapping/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME parallaxmapping)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/parallaxmapping/build.gradle b/android/examples/parallaxmapping/build.gradle
deleted file mode 100644
index 68100a2a..00000000
--- a/android/examples/parallaxmapping/build.gradle
+++ /dev/null
@@ -1,78 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanParallaxmapping"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/parallaxmapping'
- into 'assets/shaders/glsl/parallaxmapping'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'plane.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'rocks_normal_height_rgba.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'rocks_color*.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/parallaxmapping/src/main/AndroidManifest.xml b/android/examples/parallaxmapping/src/main/AndroidManifest.xml
deleted file mode 100644
index a2b56a7a..00000000
--- a/android/examples/parallaxmapping/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/parallaxmapping/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/parallaxmapping/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/parallaxmapping/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/particlesystem/CMakeLists.txt b/android/examples/particlesystem/CMakeLists.txt
deleted file mode 100644
index 99a3861e..00000000
--- a/android/examples/particlesystem/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME particlesystem)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/particlesystem/build.gradle b/android/examples/particlesystem/build.gradle
deleted file mode 100644
index 054da9c9..00000000
--- a/android/examples/particlesystem/build.gradle
+++ /dev/null
@@ -1,90 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanParticlesystem"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/particlesystem'
- into 'assets/shaders/glsl/particlesystem'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'fireplace.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'particle_fire.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'particle_smoke.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'fireplace_normalmap*.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'fireplace_colormap*.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/particlesystem/src/main/AndroidManifest.xml b/android/examples/particlesystem/src/main/AndroidManifest.xml
deleted file mode 100644
index 51a08ade..00000000
--- a/android/examples/particlesystem/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/particlesystem/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/particlesystem/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/particlesystem/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/pbrbasic/CMakeLists.txt b/android/examples/pbrbasic/CMakeLists.txt
deleted file mode 100644
index fccf7131..00000000
--- a/android/examples/pbrbasic/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME pbrbasic)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/pbrbasic/build.gradle b/android/examples/pbrbasic/build.gradle
deleted file mode 100644
index 1dd8a954..00000000
--- a/android/examples/pbrbasic/build.gradle
+++ /dev/null
@@ -1,84 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanPBRBasic"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/pbrbasic'
- into 'assets/shaders/glsl/pbrbasic'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'sphere.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'teapot.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'torusknot.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'venus.gltf'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/pbrbasic/src/main/AndroidManifest.xml b/android/examples/pbrbasic/src/main/AndroidManifest.xml
deleted file mode 100644
index 38e5241a..00000000
--- a/android/examples/pbrbasic/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/pbrbasic/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/pbrbasic/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/pbrbasic/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/pbribl/CMakeLists.txt b/android/examples/pbribl/CMakeLists.txt
deleted file mode 100644
index daaf7c9c..00000000
--- a/android/examples/pbribl/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME pbribl)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/pbribl/build.gradle b/android/examples/pbribl/build.gradle
deleted file mode 100644
index a2661f5f..00000000
--- a/android/examples/pbribl/build.gradle
+++ /dev/null
@@ -1,96 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanPBRIBL"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/pbribl'
- into 'assets/shaders/glsl/pbribl'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'cube.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'sphere.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'teapot.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'torusknot.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'venus.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures/hdr'
- into 'assets/textures/hdr'
- include 'pisa_cube.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/pbribl/src/main/AndroidManifest.xml b/android/examples/pbribl/src/main/AndroidManifest.xml
deleted file mode 100644
index af6d2595..00000000
--- a/android/examples/pbribl/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/pbribl/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/pbribl/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/pbribl/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/pbrtexture/CMakeLists.txt b/android/examples/pbrtexture/CMakeLists.txt
deleted file mode 100644
index 1f08cd14..00000000
--- a/android/examples/pbrtexture/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME pbrtexture)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/pbrtexture/build.gradle b/android/examples/pbrtexture/build.gradle
deleted file mode 100644
index d1ca4b6f..00000000
--- a/android/examples/pbrtexture/build.gradle
+++ /dev/null
@@ -1,78 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanPBRTexture"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/pbrtexture'
- into 'assets/shaders/glsl/pbrtexture'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'cube.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures/hdr'
- into 'assets/textures/hdr'
- include 'gcanyon_cube.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models/cerberus'
- into 'assets/models/cerberus'
- include '*.*'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/pbrtexture/src/main/AndroidManifest.xml b/android/examples/pbrtexture/src/main/AndroidManifest.xml
deleted file mode 100644
index 2f048ce4..00000000
--- a/android/examples/pbrtexture/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/pbrtexture/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/pbrtexture/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/pbrtexture/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/pipelines/CMakeLists.txt b/android/examples/pipelines/CMakeLists.txt
deleted file mode 100644
index b9e2e61d..00000000
--- a/android/examples/pipelines/CMakeLists.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME pipelines)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/gli)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/pipelines/build.gradle b/android/examples/pipelines/build.gradle
deleted file mode 100644
index 5ea5befa..00000000
--- a/android/examples/pipelines/build.gradle
+++ /dev/null
@@ -1,66 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanPipelines"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/pipelines'
- into 'assets/shaders/glsl/pipelines'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'treasure_smooth.gltf'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/pipelines/src/main/AndroidManifest.xml b/android/examples/pipelines/src/main/AndroidManifest.xml
deleted file mode 100644
index 6fb6beed..00000000
--- a/android/examples/pipelines/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/pipelines/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/pipelines/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/pipelines/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/pipelinestatistics/CMakeLists.txt b/android/examples/pipelinestatistics/CMakeLists.txt
deleted file mode 100644
index c2bbec2b..00000000
--- a/android/examples/pipelinestatistics/CMakeLists.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME pipelinestatistics)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/gli)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/pipelinestatistics/build.gradle b/android/examples/pipelinestatistics/build.gradle
deleted file mode 100644
index 37a65c3e..00000000
--- a/android/examples/pipelinestatistics/build.gradle
+++ /dev/null
@@ -1,84 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanPipelinestatistics"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/pipelinestatistics'
- into 'assets/shaders/glsl/pipelinestatistics'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'sphere.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'teapot.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'torusknot.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'venus.gltf'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/pipelinestatistics/src/main/AndroidManifest.xml b/android/examples/pipelinestatistics/src/main/AndroidManifest.xml
deleted file mode 100644
index 383bdc9a..00000000
--- a/android/examples/pipelinestatistics/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/pipelinestatistics/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/pipelinestatistics/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/pipelinestatistics/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/pushconstants/CMakeLists.txt b/android/examples/pushconstants/CMakeLists.txt
deleted file mode 100644
index 349ad3c1..00000000
--- a/android/examples/pushconstants/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME pushconstants)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/pushconstants/build.gradle b/android/examples/pushconstants/build.gradle
deleted file mode 100644
index 7bc6f50e..00000000
--- a/android/examples/pushconstants/build.gradle
+++ /dev/null
@@ -1,72 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanPushconstants"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/pushconstants'
- into 'assets/shaders/glsl/pushconstants'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'sphere.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'samplescene.gltf'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/pushconstants/src/main/AndroidManifest.xml b/android/examples/pushconstants/src/main/AndroidManifest.xml
deleted file mode 100644
index ae50caea..00000000
--- a/android/examples/pushconstants/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/pushconstants/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/pushconstants/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/pushconstants/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/pushdescriptors/CMakeLists.txt b/android/examples/pushdescriptors/CMakeLists.txt
deleted file mode 100644
index cecf5905..00000000
--- a/android/examples/pushdescriptors/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME pushdescriptors)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/pushdescriptors/build.gradle b/android/examples/pushdescriptors/build.gradle
deleted file mode 100644
index 87155a70..00000000
--- a/android/examples/pushdescriptors/build.gradle
+++ /dev/null
@@ -1,78 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanPushdescriptors"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/pushdescriptors'
- into 'assets/shaders/glsl/pushdescriptors'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'cube.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'crate01_color_height_rgba.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'crate02_color_height_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/pushdescriptors/src/main/AndroidManifest.xml b/android/examples/pushdescriptors/src/main/AndroidManifest.xml
deleted file mode 100644
index f16f8336..00000000
--- a/android/examples/pushdescriptors/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/pushdescriptors/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/pushdescriptors/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/pushdescriptors/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/radialblur/CMakeLists.txt b/android/examples/radialblur/CMakeLists.txt
deleted file mode 100644
index b684bad9..00000000
--- a/android/examples/radialblur/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME radialblur)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/radialblur/build.gradle b/android/examples/radialblur/build.gradle
deleted file mode 100644
index fcfbe6d1..00000000
--- a/android/examples/radialblur/build.gradle
+++ /dev/null
@@ -1,72 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanRadialblur"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/radialblur'
- into 'assets/shaders/glsl/radialblur'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'glowsphere.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'particle_gradient_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/radialblur/src/main/AndroidManifest.xml b/android/examples/radialblur/src/main/AndroidManifest.xml
deleted file mode 100644
index fc5cbf05..00000000
--- a/android/examples/radialblur/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/radialblur/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/radialblur/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/radialblur/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/rayquery/CMakeLists.txt b/android/examples/rayquery/CMakeLists.txt
deleted file mode 100644
index 4d29127a..00000000
--- a/android/examples/rayquery/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME rayquery)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/rayquery/build.gradle b/android/examples/rayquery/build.gradle
deleted file mode 100644
index 75b084ca..00000000
--- a/android/examples/rayquery/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanRayQuery"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/rayquery'
- into 'assets/shaders/glsl/rayquery'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'vulkanscene_shadow.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/rayquery/src/main/AndroidManifest.xml b/android/examples/rayquery/src/main/AndroidManifest.xml
deleted file mode 100644
index c39760fa..00000000
--- a/android/examples/rayquery/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/rayquery/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/rayquery/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/rayquery/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/raytracingbasic/CMakeLists.txt b/android/examples/raytracingbasic/CMakeLists.txt
deleted file mode 100644
index 25138d07..00000000
--- a/android/examples/raytracingbasic/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME raytracingbasic)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/raytracingbasic/build.gradle b/android/examples/raytracingbasic/build.gradle
deleted file mode 100644
index 3e2cabc9..00000000
--- a/android/examples/raytracingbasic/build.gradle
+++ /dev/null
@@ -1,60 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanRaytracingbasic"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/raytracingbasic'
- into 'assets/shaders/glsl/raytracingbasic'
- include '*.*'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/raytracingbasic/src/main/AndroidManifest.xml b/android/examples/raytracingbasic/src/main/AndroidManifest.xml
deleted file mode 100644
index 0336f20c..00000000
--- a/android/examples/raytracingbasic/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/raytracingbasic/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/raytracingbasic/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/raytracingbasic/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/raytracingcallable/CMakeLists.txt b/android/examples/raytracingcallable/CMakeLists.txt
deleted file mode 100644
index 02fbd15d..00000000
--- a/android/examples/raytracingcallable/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME raytracingcallable)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/raytracingcallable/build.gradle b/android/examples/raytracingcallable/build.gradle
deleted file mode 100644
index ce9a314e..00000000
--- a/android/examples/raytracingcallable/build.gradle
+++ /dev/null
@@ -1,59 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanRaytracingcallable"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/raytracingcallable'
- into 'assets/shaders/glsl/raytracingcallable'
- include '*.*'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/raytracingcallable/src/main/AndroidManifest.xml b/android/examples/raytracingcallable/src/main/AndroidManifest.xml
deleted file mode 100644
index 48486a72..00000000
--- a/android/examples/raytracingcallable/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/raytracingcallable/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/raytracingcallable/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/raytracingcallable/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/raytracinggltf/CMakeLists.txt b/android/examples/raytracinggltf/CMakeLists.txt
deleted file mode 100644
index bfe906f1..00000000
--- a/android/examples/raytracinggltf/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME raytracinggltf)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/raytracinggltf/build.gradle b/android/examples/raytracinggltf/build.gradle
deleted file mode 100644
index 2f8df33e..00000000
--- a/android/examples/raytracinggltf/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanRaytracinggltf"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/raytracinggltf'
- into 'assets/shaders/glsl/raytracinggltf'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models/FlightHelmet/glTF'
- into 'assets/models/FlightHelmet/glTF'
- include '*.*'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/raytracinggltf/src/main/AndroidManifest.xml b/android/examples/raytracinggltf/src/main/AndroidManifest.xml
deleted file mode 100644
index 8814f938..00000000
--- a/android/examples/raytracinggltf/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/android/examples/raytracinggltf/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/raytracinggltf/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/raytracinggltf/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/raytracingintersection/CMakeLists.txt b/android/examples/raytracingintersection/CMakeLists.txt
deleted file mode 100644
index 5ae76ede..00000000
--- a/android/examples/raytracingintersection/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME raytracingintersection)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/raytracingintersection/build.gradle b/android/examples/raytracingintersection/build.gradle
deleted file mode 100644
index d0219af5..00000000
--- a/android/examples/raytracingintersection/build.gradle
+++ /dev/null
@@ -1,59 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanRaytracingintersection"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/raytracingintersection'
- into 'assets/shaders/glsl/raytracingintersection'
- include '*.*'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/raytracingintersection/src/main/AndroidManifest.xml b/android/examples/raytracingintersection/src/main/AndroidManifest.xml
deleted file mode 100644
index 79217a3d..00000000
--- a/android/examples/raytracingintersection/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/raytracingintersection/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/raytracingintersection/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/raytracingintersection/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/raytracingpositionfetch/CMakeLists.txt b/android/examples/raytracingpositionfetch/CMakeLists.txt
deleted file mode 100644
index 04f57764..00000000
--- a/android/examples/raytracingpositionfetch/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME raytracingpositionfetch)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/raytracingpositionfetch/build.gradle b/android/examples/raytracingpositionfetch/build.gradle
deleted file mode 100644
index b70bb790..00000000
--- a/android/examples/raytracingpositionfetch/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanRaytracingpositionfetch"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/raytracingpositionfetch'
- into 'assets/shaders/glsl/raytracingpositionfetch'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'treasure_smooth.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/raytracingpositionfetch/src/main/AndroidManifest.xml b/android/examples/raytracingpositionfetch/src/main/AndroidManifest.xml
deleted file mode 100644
index 9083b536..00000000
--- a/android/examples/raytracingpositionfetch/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/raytracingpositionfetch/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/raytracingpositionfetch/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/raytracingpositionfetch/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/raytracingreflections/CMakeLists.txt b/android/examples/raytracingreflections/CMakeLists.txt
deleted file mode 100644
index cba5509a..00000000
--- a/android/examples/raytracingreflections/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME raytracingreflections)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/raytracingreflections/build.gradle b/android/examples/raytracingreflections/build.gradle
deleted file mode 100644
index 55c50d32..00000000
--- a/android/examples/raytracingreflections/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanRaytracingreflections"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/raytracingreflections'
- into 'assets/shaders/glsl/raytracingreflections'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'reflection_scene.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/raytracingreflections/src/main/AndroidManifest.xml b/android/examples/raytracingreflections/src/main/AndroidManifest.xml
deleted file mode 100644
index 1fe9d2d3..00000000
--- a/android/examples/raytracingreflections/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/raytracingreflections/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/raytracingreflections/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/raytracingreflections/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/raytracingsbtdata/CMakeLists.txt b/android/examples/raytracingsbtdata/CMakeLists.txt
deleted file mode 100644
index 103555e5..00000000
--- a/android/examples/raytracingsbtdata/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME raytracingsbtdata)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/raytracingsbtdata/build.gradle b/android/examples/raytracingsbtdata/build.gradle
deleted file mode 100644
index b495acd8..00000000
--- a/android/examples/raytracingsbtdata/build.gradle
+++ /dev/null
@@ -1,59 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanRaytracingsbtdata"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/raytracingsbtdata'
- into 'assets/shaders/glsl/raytracingsbtdata'
- include '*.*'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/raytracingsbtdata/src/main/AndroidManifest.xml b/android/examples/raytracingsbtdata/src/main/AndroidManifest.xml
deleted file mode 100644
index 75e7fea6..00000000
--- a/android/examples/raytracingsbtdata/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/raytracingsbtdata/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/raytracingsbtdata/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/raytracingsbtdata/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/raytracingshadows/CMakeLists.txt b/android/examples/raytracingshadows/CMakeLists.txt
deleted file mode 100644
index d273e282..00000000
--- a/android/examples/raytracingshadows/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME raytracingshadows)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/raytracingshadows/build.gradle b/android/examples/raytracingshadows/build.gradle
deleted file mode 100644
index e951cba9..00000000
--- a/android/examples/raytracingshadows/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanRaytracingshadows"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/raytracingshadows'
- into 'assets/shaders/glsl/raytracingshadows'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'vulkanscene_shadow.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/raytracingshadows/src/main/AndroidManifest.xml b/android/examples/raytracingshadows/src/main/AndroidManifest.xml
deleted file mode 100644
index 9888eec4..00000000
--- a/android/examples/raytracingshadows/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/raytracingshadows/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/raytracingshadows/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/raytracingshadows/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/raytracingtextures/CMakeLists.txt b/android/examples/raytracingtextures/CMakeLists.txt
deleted file mode 100644
index cf3fad0c..00000000
--- a/android/examples/raytracingtextures/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME raytracingtextures)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/raytracingtextures/build.gradle b/android/examples/raytracingtextures/build.gradle
deleted file mode 100644
index d9abe667..00000000
--- a/android/examples/raytracingtextures/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanRaytracingtextures"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/raytracingtextures'
- into 'assets/shaders/glsl/raytracingtextures'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'gratefloor_rgba.ktx'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/raytracingtextures/src/main/AndroidManifest.xml b/android/examples/raytracingtextures/src/main/AndroidManifest.xml
deleted file mode 100644
index 6d1b12e2..00000000
--- a/android/examples/raytracingtextures/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/raytracingtextures/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/raytracingtextures/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/raytracingtextures/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/renderheadless/CMakeLists.txt b/android/examples/renderheadless/CMakeLists.txt
deleted file mode 100644
index 6e7b3bb1..00000000
--- a/android/examples/renderheadless/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME renderheadless)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/renderheadless/build.gradle b/android/examples/renderheadless/build.gradle
deleted file mode 100644
index 87bc76e8..00000000
--- a/android/examples/renderheadless/build.gradle
+++ /dev/null
@@ -1,60 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanRenderheadless"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/renderheadless'
- into 'assets/shaders/glsl/renderheadless'
- include '*.*'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/renderheadless/src/main/AndroidManifest.xml b/android/examples/renderheadless/src/main/AndroidManifest.xml
deleted file mode 100644
index 918f513b..00000000
--- a/android/examples/renderheadless/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/renderheadless/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/renderheadless/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/renderheadless/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/screenshot/CMakeLists.txt b/android/examples/screenshot/CMakeLists.txt
deleted file mode 100644
index 1ef51c7d..00000000
--- a/android/examples/screenshot/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME screenshot)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/screenshot/build.gradle b/android/examples/screenshot/build.gradle
deleted file mode 100644
index 196a6aa9..00000000
--- a/android/examples/screenshot/build.gradle
+++ /dev/null
@@ -1,66 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanScreenshot"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/screenshot'
- into 'assets/shaders/glsl/screenshot'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'chinesedragon.gltf'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/screenshot/src/main/AndroidManifest.xml b/android/examples/screenshot/src/main/AndroidManifest.xml
deleted file mode 100644
index 829bbf20..00000000
--- a/android/examples/screenshot/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/screenshot/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/screenshot/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/screenshot/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/shaderobjects/CMakeLists.txt b/android/examples/shaderobjects/CMakeLists.txt
deleted file mode 100644
index 90086789..00000000
--- a/android/examples/shaderobjects/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME shaderobjects)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/shaderobjects/build.gradle b/android/examples/shaderobjects/build.gradle
deleted file mode 100644
index ce056707..00000000
--- a/android/examples/shaderobjects/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanShaderobjects"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/shaderobjects'
- into 'assets/shaders/glsl/shaderobjects'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'treasure_smooth.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/shaderobjects/src/main/AndroidManifest.xml b/android/examples/shaderobjects/src/main/AndroidManifest.xml
deleted file mode 100644
index 0f6f6c43..00000000
--- a/android/examples/shaderobjects/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/shaderobjects/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/shaderobjects/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/shaderobjects/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/shadowmapping/CMakeLists.txt b/android/examples/shadowmapping/CMakeLists.txt
deleted file mode 100644
index 2400cff9..00000000
--- a/android/examples/shadowmapping/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME shadowmapping)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/shadowmapping/build.gradle b/android/examples/shadowmapping/build.gradle
deleted file mode 100644
index e25b24a8..00000000
--- a/android/examples/shadowmapping/build.gradle
+++ /dev/null
@@ -1,71 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanShadowmapping"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/shadowmapping'
- into 'assets/shaders/glsl/shadowmapping'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'vulkanscene_shadow.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'samplescene.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
diff --git a/android/examples/shadowmapping/src/main/AndroidManifest.xml b/android/examples/shadowmapping/src/main/AndroidManifest.xml
deleted file mode 100644
index 859e5afc..00000000
--- a/android/examples/shadowmapping/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/shadowmapping/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/shadowmapping/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/shadowmapping/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/shadowmappingcascade/CMakeLists.txt b/android/examples/shadowmappingcascade/CMakeLists.txt
deleted file mode 100644
index d5ce298f..00000000
--- a/android/examples/shadowmappingcascade/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME shadowmappingcascade)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/shadowmappingcascade/build.gradle b/android/examples/shadowmappingcascade/build.gradle
deleted file mode 100644
index ce5064d5..00000000
--- a/android/examples/shadowmappingcascade/build.gradle
+++ /dev/null
@@ -1,71 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanShadowmappingcascade"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/shadowmappingcascade'
- into 'assets/shaders/glsl/shadowmappingcascade'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'terrain_gridlines.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'oaktree.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/shadowmappingcascade/src/main/AndroidManifest.xml b/android/examples/shadowmappingcascade/src/main/AndroidManifest.xml
deleted file mode 100644
index 9eb23c03..00000000
--- a/android/examples/shadowmappingcascade/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/shadowmappingcascade/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/shadowmappingcascade/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/shadowmappingcascade/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/shadowmappingomni/CMakeLists.txt b/android/examples/shadowmappingomni/CMakeLists.txt
deleted file mode 100644
index 06ff0248..00000000
--- a/android/examples/shadowmappingomni/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME shadowmappingomni)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/shadowmappingomni/build.gradle b/android/examples/shadowmappingomni/build.gradle
deleted file mode 100644
index 019a4341..00000000
--- a/android/examples/shadowmappingomni/build.gradle
+++ /dev/null
@@ -1,72 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanShadowmappingomni"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/shadowmappingomni'
- into 'assets/shaders/glsl/shadowmappingomni'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'shadowscene_fire.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'cube.gltf'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/shadowmappingomni/src/main/AndroidManifest.xml b/android/examples/shadowmappingomni/src/main/AndroidManifest.xml
deleted file mode 100644
index 0fe3262a..00000000
--- a/android/examples/shadowmappingomni/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/shadowmappingomni/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/shadowmappingomni/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/shadowmappingomni/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/specializationconstants/CMakeLists.txt b/android/examples/specializationconstants/CMakeLists.txt
deleted file mode 100644
index 179842ab..00000000
--- a/android/examples/specializationconstants/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME specializationconstants)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/specializationconstants/build.gradle b/android/examples/specializationconstants/build.gradle
deleted file mode 100644
index c48bbd84..00000000
--- a/android/examples/specializationconstants/build.gradle
+++ /dev/null
@@ -1,72 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanSpecializationconstants"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/specializationconstants'
- into 'assets/shaders/glsl/specializationconstants'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'color_teapot_spheres.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'metalplate_nomips_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/specializationconstants/src/main/AndroidManifest.xml b/android/examples/specializationconstants/src/main/AndroidManifest.xml
deleted file mode 100644
index aa6e33c0..00000000
--- a/android/examples/specializationconstants/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/specializationconstants/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/specializationconstants/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/specializationconstants/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/sphericalenvmapping/CMakeLists.txt b/android/examples/sphericalenvmapping/CMakeLists.txt
deleted file mode 100644
index 810d62e6..00000000
--- a/android/examples/sphericalenvmapping/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME sphericalenvmapping)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/sphericalenvmapping/build.gradle b/android/examples/sphericalenvmapping/build.gradle
deleted file mode 100644
index e542ccd4..00000000
--- a/android/examples/sphericalenvmapping/build.gradle
+++ /dev/null
@@ -1,72 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanSphericalenvmapping"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/sphericalenvmapping'
- into 'assets/shaders/glsl/sphericalenvmapping'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'chinesedragon.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'matcap_array_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/sphericalenvmapping/src/main/AndroidManifest.xml b/android/examples/sphericalenvmapping/src/main/AndroidManifest.xml
deleted file mode 100644
index 17a4f280..00000000
--- a/android/examples/sphericalenvmapping/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/sphericalenvmapping/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/sphericalenvmapping/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/sphericalenvmapping/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/ssao/CMakeLists.txt b/android/examples/ssao/CMakeLists.txt
deleted file mode 100644
index 7a4355d5..00000000
--- a/android/examples/ssao/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME ssao)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/ssao/build.gradle b/android/examples/ssao/build.gradle
deleted file mode 100644
index d9f76090..00000000
--- a/android/examples/ssao/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanSSAO"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/ssao'
- into 'assets/shaders/glsl/ssao'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models/sponza'
- into 'assets/models/sponza'
- include '*.*'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/ssao/src/main/AndroidManifest.xml b/android/examples/ssao/src/main/AndroidManifest.xml
deleted file mode 100644
index dad1de75..00000000
--- a/android/examples/ssao/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/ssao/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/ssao/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/ssao/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/stencilbuffer/CMakeLists.txt b/android/examples/stencilbuffer/CMakeLists.txt
deleted file mode 100644
index 5f75f0f7..00000000
--- a/android/examples/stencilbuffer/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME stencilbuffer)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/stencilbuffer/build.gradle b/android/examples/stencilbuffer/build.gradle
deleted file mode 100644
index 10f97582..00000000
--- a/android/examples/stencilbuffer/build.gradle
+++ /dev/null
@@ -1,66 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanStencilbuffer"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/stencilbuffer'
- into 'assets/shaders/glsl/stencilbuffer'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'venus.gltf'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/stencilbuffer/src/main/AndroidManifest.xml b/android/examples/stencilbuffer/src/main/AndroidManifest.xml
deleted file mode 100644
index 8b020316..00000000
--- a/android/examples/stencilbuffer/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/stencilbuffer/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/stencilbuffer/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/stencilbuffer/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/subpasses/CMakeLists.txt b/android/examples/subpasses/CMakeLists.txt
deleted file mode 100644
index 707fbbc4..00000000
--- a/android/examples/subpasses/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME subpasses)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/subpasses/build.gradle b/android/examples/subpasses/build.gradle
deleted file mode 100644
index 9e83166d..00000000
--- a/android/examples/subpasses/build.gradle
+++ /dev/null
@@ -1,78 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanSubpasses"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/subpasses'
- into 'assets/shaders/glsl/subpasses'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'samplebuilding.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'samplebuilding_glass.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'colored_glass_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/subpasses/src/main/AndroidManifest.xml b/android/examples/subpasses/src/main/AndroidManifest.xml
deleted file mode 100644
index 3a7a1325..00000000
--- a/android/examples/subpasses/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/subpasses/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/subpasses/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/subpasses/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/terraintessellation/CMakeLists.txt b/android/examples/terraintessellation/CMakeLists.txt
deleted file mode 100644
index ad3a0bf6..00000000
--- a/android/examples/terraintessellation/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME terraintessellation)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/terraintessellation/build.gradle b/android/examples/terraintessellation/build.gradle
deleted file mode 100644
index 4400df2d..00000000
--- a/android/examples/terraintessellation/build.gradle
+++ /dev/null
@@ -1,84 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanTerraintessellation"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/terraintessellation'
- into 'assets/shaders/glsl/terraintessellation'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'sphere.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'skysphere*.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'terrain_texturearray*.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'terrain_heightmap_r16.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/terraintessellation/src/main/AndroidManifest.xml b/android/examples/terraintessellation/src/main/AndroidManifest.xml
deleted file mode 100644
index f40a43ca..00000000
--- a/android/examples/terraintessellation/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/terraintessellation/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/terraintessellation/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/terraintessellation/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/tessellation/CMakeLists.txt b/android/examples/tessellation/CMakeLists.txt
deleted file mode 100644
index 0de786e5..00000000
--- a/android/examples/tessellation/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME tessellation)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/tessellation/build.gradle b/android/examples/tessellation/build.gradle
deleted file mode 100644
index e60902a1..00000000
--- a/android/examples/tessellation/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanTessellation"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/tessellation'
- into 'assets/shaders/glsl/tessellation'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'deer.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/tessellation/src/main/AndroidManifest.xml b/android/examples/tessellation/src/main/AndroidManifest.xml
deleted file mode 100644
index d9733f1d..00000000
--- a/android/examples/tessellation/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/tessellation/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/tessellation/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/tessellation/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/textoverlay/CMakeLists.txt b/android/examples/textoverlay/CMakeLists.txt
deleted file mode 100644
index 8f8f962a..00000000
--- a/android/examples/textoverlay/CMakeLists.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME textoverlay)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/gli)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/textoverlay/build.gradle b/android/examples/textoverlay/build.gradle
deleted file mode 100644
index 617bcc81..00000000
--- a/android/examples/textoverlay/build.gradle
+++ /dev/null
@@ -1,66 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanTextoverlay"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/textoverlay'
- into 'assets/shaders/glsl/textoverlay'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'cube.gltf'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/textoverlay/src/main/AndroidManifest.xml b/android/examples/textoverlay/src/main/AndroidManifest.xml
deleted file mode 100644
index 0d0144e3..00000000
--- a/android/examples/textoverlay/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/textoverlay/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/textoverlay/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/textoverlay/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/texture/CMakeLists.txt b/android/examples/texture/CMakeLists.txt
deleted file mode 100644
index a743d972..00000000
--- a/android/examples/texture/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME texture)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/texture/build.gradle b/android/examples/texture/build.gradle
deleted file mode 100644
index 61f08645..00000000
--- a/android/examples/texture/build.gradle
+++ /dev/null
@@ -1,66 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanTexture"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/texture'
- into 'assets/shaders/glsl/texture'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'metalplate01_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/texture/src/main/AndroidManifest.xml b/android/examples/texture/src/main/AndroidManifest.xml
deleted file mode 100644
index fc670531..00000000
--- a/android/examples/texture/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/texture/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/texture/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/texture/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/texture3d/CMakeLists.txt b/android/examples/texture3d/CMakeLists.txt
deleted file mode 100644
index 86a9a06f..00000000
--- a/android/examples/texture3d/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME texture3d)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/texture3d/build.gradle b/android/examples/texture3d/build.gradle
deleted file mode 100644
index 9805bfa5..00000000
--- a/android/examples/texture3d/build.gradle
+++ /dev/null
@@ -1,60 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanTexture3d"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/texture3d'
- into 'assets/shaders/glsl/texture3d'
- include '*.*'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/texture3d/src/main/AndroidManifest.xml b/android/examples/texture3d/src/main/AndroidManifest.xml
deleted file mode 100644
index 0d74927b..00000000
--- a/android/examples/texture3d/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/texture3d/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/texture3d/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/texture3d/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/texturearray/CMakeLists.txt b/android/examples/texturearray/CMakeLists.txt
deleted file mode 100644
index f1932575..00000000
--- a/android/examples/texturearray/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME texturearray)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/texturearray/build.gradle b/android/examples/texturearray/build.gradle
deleted file mode 100644
index 90b528b2..00000000
--- a/android/examples/texturearray/build.gradle
+++ /dev/null
@@ -1,66 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanTexturearray"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/texturearray'
- into 'assets/shaders/glsl/texturearray'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'texturearray_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/texturearray/src/main/AndroidManifest.xml b/android/examples/texturearray/src/main/AndroidManifest.xml
deleted file mode 100644
index c1a04330..00000000
--- a/android/examples/texturearray/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/texturearray/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/texturearray/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/texturearray/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/texturecubemap/CMakeLists.txt b/android/examples/texturecubemap/CMakeLists.txt
deleted file mode 100644
index 02f574e3..00000000
--- a/android/examples/texturecubemap/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME texturecubemap)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/texturecubemap/build.gradle b/android/examples/texturecubemap/build.gradle
deleted file mode 100644
index dbcfc8a9..00000000
--- a/android/examples/texturecubemap/build.gradle
+++ /dev/null
@@ -1,96 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanTexturecubemap"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/texturecubemap'
- into 'assets/shaders/glsl/texturecubemap'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'sphere.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'teapot.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'torusknot.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'cube.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'venus.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'cubemap_yokohama_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/texturecubemap/src/main/AndroidManifest.xml b/android/examples/texturecubemap/src/main/AndroidManifest.xml
deleted file mode 100644
index e2914845..00000000
--- a/android/examples/texturecubemap/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/texturecubemap/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/texturecubemap/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/texturecubemap/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/texturecubemaparray/CMakeLists.txt b/android/examples/texturecubemaparray/CMakeLists.txt
deleted file mode 100644
index 24ca68e0..00000000
--- a/android/examples/texturecubemaparray/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME texturecubemaparray)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/texturecubemaparray/build.gradle b/android/examples/texturecubemaparray/build.gradle
deleted file mode 100644
index a9f68f4d..00000000
--- a/android/examples/texturecubemaparray/build.gradle
+++ /dev/null
@@ -1,96 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanTexturecubemapArray"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/texturecubemaparray'
- into 'assets/shaders/glsl/texturecubemaparray'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'sphere.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'teapot.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'torusknot.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'cube.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'venus.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'cubemap_array.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/texturecubemaparray/src/main/AndroidManifest.xml b/android/examples/texturecubemaparray/src/main/AndroidManifest.xml
deleted file mode 100644
index 2e087df9..00000000
--- a/android/examples/texturecubemaparray/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/texturecubemaparray/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/texturecubemaparray/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/texturecubemaparray/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/texturemipmapgen/CMakeLists.txt b/android/examples/texturemipmapgen/CMakeLists.txt
deleted file mode 100644
index 8a56121b..00000000
--- a/android/examples/texturemipmapgen/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME texturemipmapgen)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/texturemipmapgen/build.gradle b/android/examples/texturemipmapgen/build.gradle
deleted file mode 100644
index 8249c6a3..00000000
--- a/android/examples/texturemipmapgen/build.gradle
+++ /dev/null
@@ -1,72 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanTexturemipmapgen"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/texturemipmapgen'
- into 'assets/shaders/glsl/texturemipmapgen'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'tunnel_cylinder.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'metalplate_nomips_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/texturemipmapgen/src/main/AndroidManifest.xml b/android/examples/texturemipmapgen/src/main/AndroidManifest.xml
deleted file mode 100644
index 8c914217..00000000
--- a/android/examples/texturemipmapgen/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/texturemipmapgen/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/texturemipmapgen/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/texturemipmapgen/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/texturesparseresidency/CMakeLists.txt b/android/examples/texturesparseresidency/CMakeLists.txt
deleted file mode 100644
index 9f5d6571..00000000
--- a/android/examples/texturesparseresidency/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME texturesparseresidency)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/texturesparseresidency/build.gradle b/android/examples/texturesparseresidency/build.gradle
deleted file mode 100644
index 505f4700..00000000
--- a/android/examples/texturesparseresidency/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanTexturesparseresidency"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/texturesparseresidency'
- into 'assets/shaders/glsl/texturesparseresidency'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'plane.gltf'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/texturesparseresidency/src/main/AndroidManifest.xml b/android/examples/texturesparseresidency/src/main/AndroidManifest.xml
deleted file mode 100644
index cc16f382..00000000
--- a/android/examples/texturesparseresidency/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/texturesparseresidency/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/texturesparseresidency/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/texturesparseresidency/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/timelinesemaphore/CMakeLists.txt b/android/examples/timelinesemaphore/CMakeLists.txt
deleted file mode 100644
index 2d2bd833..00000000
--- a/android/examples/timelinesemaphore/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME timelinesemaphore)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/timelinesemaphore/build.gradle b/android/examples/timelinesemaphore/build.gradle
deleted file mode 100644
index 3da087d6..00000000
--- a/android/examples/timelinesemaphore/build.gradle
+++ /dev/null
@@ -1,72 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanTimelinesemaphore"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/computenbody'
- into 'assets/shaders/glsl/computenbody'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'particle01_rgba.ktx'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'particle_gradient_rgba.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/timelinesemaphore/src/main/AndroidManifest.xml b/android/examples/timelinesemaphore/src/main/AndroidManifest.xml
deleted file mode 100644
index 821c8f6b..00000000
--- a/android/examples/timelinesemaphore/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/timelinesemaphore/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/timelinesemaphore/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/timelinesemaphore/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/triangle/CMakeLists.txt b/android/examples/triangle/CMakeLists.txt
deleted file mode 100644
index 13727990..00000000
--- a/android/examples/triangle/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME triangle)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/triangle/build.gradle b/android/examples/triangle/build.gradle
deleted file mode 100644
index 5412f397..00000000
--- a/android/examples/triangle/build.gradle
+++ /dev/null
@@ -1,60 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanTriangle"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/triangle'
- into 'assets/shaders/glsl/triangle'
- include '*.*'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/triangle/src/main/AndroidManifest.xml b/android/examples/triangle/src/main/AndroidManifest.xml
deleted file mode 100644
index 020c6835..00000000
--- a/android/examples/triangle/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/triangle/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/triangle/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/triangle/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/trianglevulkan13/CMakeLists.txt b/android/examples/trianglevulkan13/CMakeLists.txt
deleted file mode 100644
index e2b2f44e..00000000
--- a/android/examples/trianglevulkan13/CMakeLists.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME trianglevulkan13)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/trianglevulkan13/build.gradle b/android/examples/trianglevulkan13/build.gradle
deleted file mode 100644
index 542a3d29..00000000
--- a/android/examples/trianglevulkan13/build.gradle
+++ /dev/null
@@ -1,59 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanTrianglevulkan13"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/triangle'
- into 'assets/shaders/glsl/triangle'
- include '*.*'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/trianglevulkan13/src/main/AndroidManifest.xml b/android/examples/trianglevulkan13/src/main/AndroidManifest.xml
deleted file mode 100644
index 206434ef..00000000
--- a/android/examples/trianglevulkan13/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/trianglevulkan13/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/trianglevulkan13/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/trianglevulkan13/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/variablerateshading/CMakeLists.txt b/android/examples/variablerateshading/CMakeLists.txt
deleted file mode 100644
index c6536178..00000000
--- a/android/examples/variablerateshading/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME variablerateshading)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/variablerateshading/build.gradle b/android/examples/variablerateshading/build.gradle
deleted file mode 100644
index 5422e6d6..00000000
--- a/android/examples/variablerateshading/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanVariablerateshading"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/variablerateshading'
- into 'assets/shaders/glsl/variablerateshading'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models/sponza'
- into 'assets/models/sponza'
- include '*.*'
- }
-
-}
-
-preBuild.dependsOn copyTask
diff --git a/android/examples/variablerateshading/src/main/AndroidManifest.xml b/android/examples/variablerateshading/src/main/AndroidManifest.xml
deleted file mode 100644
index 5f51b1dd..00000000
--- a/android/examples/variablerateshading/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/variablerateshading/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/variablerateshading/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/variablerateshading/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/vertexattributes/CMakeLists.txt b/android/examples/vertexattributes/CMakeLists.txt
deleted file mode 100644
index ff8e61bb..00000000
--- a/android/examples/vertexattributes/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME vertexattributes)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/vertexattributes/build.gradle b/android/examples/vertexattributes/build.gradle
deleted file mode 100644
index 501ad04f..00000000
--- a/android/examples/vertexattributes/build.gradle
+++ /dev/null
@@ -1,65 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanVertexattributes"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/vertexattributes'
- into 'assets/shaders/glsl/vertexattributes'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models/sponza'
- into 'assets/models/sponza'
- include '*.*'
- }
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/vertexattributes/src/main/AndroidManifest.xml b/android/examples/vertexattributes/src/main/AndroidManifest.xml
deleted file mode 100644
index c78888df..00000000
--- a/android/examples/vertexattributes/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/vertexattributes/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/vertexattributes/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/vertexattributes/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/viewportarray/CMakeLists.txt b/android/examples/viewportarray/CMakeLists.txt
deleted file mode 100644
index bf64ad1f..00000000
--- a/android/examples/viewportarray/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME viewportarray)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/viewportarray/build.gradle b/android/examples/viewportarray/build.gradle
deleted file mode 100644
index fe35d477..00000000
--- a/android/examples/viewportarray/build.gradle
+++ /dev/null
@@ -1,66 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanViewportarray"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/viewportarray'
- into 'assets/shaders/glsl/viewportarray'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'sampleroom.gltf'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/viewportarray/src/main/AndroidManifest.xml b/android/examples/viewportarray/src/main/AndroidManifest.xml
deleted file mode 100644
index 921b4da7..00000000
--- a/android/examples/viewportarray/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/viewportarray/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/viewportarray/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/viewportarray/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/examples/vulkanscene/CMakeLists.txt b/android/examples/vulkanscene/CMakeLists.txt
deleted file mode 100644
index 9a166313..00000000
--- a/android/examples/vulkanscene/CMakeLists.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-cmake_minimum_required(VERSION 3.10.0 FATAL_ERROR)
-
-
-
-set(NAME vulkanscene)
-
-set(SRC_DIR ../../../examples/${NAME})
-set(BASE_DIR ../../../base)
-set(EXTERNAL_DIR ../../../external)
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -DVK_USE_PLATFORM_ANDROID_KHR -DVK_NO_PROTOTYPES")
-
-file(GLOB EXAMPLE_SRC "${SRC_DIR}/*.cpp")
-
-add_library(native-lib SHARED ${EXAMPLE_SRC})
-
-add_library(native-app-glue STATIC ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c)
-
-add_subdirectory(../base ${CMAKE_SOURCE_DIR}/../base)
-
-set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate")
-
-include_directories(${BASE_DIR})
-include_directories(${EXTERNAL_DIR})
-include_directories(${EXTERNAL_DIR}/glm)
-include_directories(${EXTERNAL_DIR}/imgui)
-include_directories(${EXTERNAL_DIR}/tinygltf)
-include_directories(${ANDROID_NDK}/sources/android/native_app_glue)
-
-target_link_libraries(
- native-lib
- native-app-glue
- libbase
- android
- log
- z
-)
diff --git a/android/examples/vulkanscene/build.gradle b/android/examples/vulkanscene/build.gradle
deleted file mode 100644
index 3a0307a9..00000000
--- a/android/examples/vulkanscene/build.gradle
+++ /dev/null
@@ -1,90 +0,0 @@
-apply plugin: 'com.android.application'
-apply from: '../gradle/outputfilename.gradle'
-
-android {
- compileSdkVersion rootProject.ext.compileSdkVersion
- defaultConfig {
- applicationId "de.saschawillems.vulkanVulkanscene"
- minSdkVersion rootProject.ext.minSdkVersion
- targetSdkVersion rootProject.ext.targetSdkVersion
- versionCode 1
- versionName "1.0"
- ndk {
- abiFilters rootProject.ext.abiFilters
- }
- externalNativeBuild {
- cmake {
- cppFlags "-std=c++14"
- arguments "-DANDROID_STL=c++_shared", '-DANDROID_TOOLCHAIN=clang'
- }
- }
- }
- sourceSets {
- main.assets.srcDirs = ['assets']
- }
- buildTypes {
- release {
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- externalNativeBuild {
- cmake {
- path "CMakeLists.txt"
- }
- }
-}
-
-task copyTask {
- copy {
- from '../../common/res/drawable'
- into "src/main/res/drawable"
- include 'icon.png'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/base'
- into 'assets/shaders/glsl/base'
- include '*.spv'
- }
-
- copy {
- from rootProject.ext.shaderPath + 'glsl/vulkanscene'
- into 'assets/shaders/glsl/vulkanscene'
- include '*.*'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'vulkanscenelogos.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'vulkanscenebackground.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'vulkanscenemodels.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'models'
- into 'assets/models'
- include 'cube.gltf'
- }
-
- copy {
- from rootProject.ext.assetPath + 'textures'
- into 'assets/textures'
- include 'cubemap_vulkan.ktx'
- }
-
-
-}
-
-preBuild.dependsOn copyTask
\ No newline at end of file
diff --git a/android/examples/vulkanscene/src/main/AndroidManifest.xml b/android/examples/vulkanscene/src/main/AndroidManifest.xml
deleted file mode 100644
index 9cb8a7a3..00000000
--- a/android/examples/vulkanscene/src/main/AndroidManifest.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/android/examples/vulkanscene/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java b/android/examples/vulkanscene/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
deleted file mode 100644
index 12e14fc6..00000000
--- a/android/examples/vulkanscene/src/main/java/de/saschawillems/vulkanSample/VulkanActivity.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2018 by Sascha Willems - www.saschawillems.de
- *
- * This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
- */
-package de.saschawillems.vulkanSample;
-
-import android.app.AlertDialog;
-import android.app.NativeActivity;
-import android.content.DialogInterface;
-import android.content.pm.ApplicationInfo;
-import android.os.Bundle;
-
-import java.util.concurrent.Semaphore;
-
-public class VulkanActivity extends NativeActivity {
-
- static {
- // Load native library
- System.loadLibrary("native-lib");
- }
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- }
-
- // Use a semaphore to create a modal dialog
-
- private final Semaphore semaphore = new Semaphore(0, true);
-
- public void showAlert(final String message)
- {
- final VulkanActivity activity = this;
-
- ApplicationInfo applicationInfo = activity.getApplicationInfo();
- final String applicationName = applicationInfo.nonLocalizedLabel.toString();
-
- this.runOnUiThread(new Runnable() {
- public void run() {
- AlertDialog.Builder builder = new AlertDialog.Builder(activity, android.R.style.Theme_Material_Dialog_Alert);
- builder.setTitle(applicationName);
- builder.setMessage(message);
- builder.setPositiveButton("Close", new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int id) {
- semaphore.release();
- }
- });
- builder.setCancelable(false);
- AlertDialog dialog = builder.create();
- dialog.show();
- }
- });
- try {
- semaphore.acquire();
- }
- catch (InterruptedException e) { }
- }
-}
diff --git a/android/gradle.properties b/android/gradle.properties
deleted file mode 100644
index 2b474b57..00000000
--- a/android/gradle.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-## For more details on how to configure your build environment visit
-# http://www.gradle.org/docs/current/userguide/build_environment.html
-#
-# Specifies the JVM arguments used for the daemon process.
-# The setting is particularly useful for tweaking memory settings.
-# Default value: -Xmx1024m -XX:MaxPermSize=256m
-# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
-#
-# When configured, Gradle will run in incubating parallel mode.
-# This option should only be used with decoupled projects. More details, visit
-# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
-# org.gradle.parallel=true
-#Sun May 28 17:34:07 CST 2023
-android.defaults.buildfeatures.buildconfig=true
-android.nonFinalResIds=false
-android.nonTransitiveRClass=false
-org.gradle.jvmargs=-Xmx4096M
diff --git a/android/gradle/wrapper/gradle-wrapper.jar b/android/gradle/wrapper/gradle-wrapper.jar
deleted file mode 100644
index 7454180f..00000000
Binary files a/android/gradle/wrapper/gradle-wrapper.jar and /dev/null differ
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
deleted file mode 100644
index 328f7a40..00000000
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ /dev/null
@@ -1,6 +0,0 @@
-#Thu Oct 10 17:55:02 CEST 2024
-distributionBase=GRADLE_USER_HOME
-distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
-zipStoreBase=GRADLE_USER_HOME
-zipStorePath=wrapper/dists
diff --git a/android/gradlew b/android/gradlew
deleted file mode 100755
index c53aefaa..00000000
--- a/android/gradlew
+++ /dev/null
@@ -1,234 +0,0 @@
-#!/bin/sh
-
-#
-# Copyright 2015-2021 the original authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# https://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-##############################################################################
-#
-# Gradle start up script for POSIX generated by Gradle.
-#
-# Important for running:
-#
-# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
-# noncompliant, but you have some other compliant shell such as ksh or
-# bash, then to run this script, type that shell name before the whole
-# command line, like:
-#
-# ksh Gradle
-#
-# Busybox and similar reduced shells will NOT work, because this script
-# requires all of these POSIX shell features:
-# * functions;
-# * expansions $var, ${var}, ${var:-default}, ${var+SET},
-# ${var#prefix}, ${var%suffix}, and $( cmd );
-# * compound commands having a testable exit status, especially case;
-# * various built-in commands including command, set, and ulimit.
-#
-# Important for patching:
-#
-# (2) This script targets any POSIX shell, so it avoids extensions provided
-# by Bash, Ksh, etc; in particular arrays are avoided.
-#
-# The "traditional" practice of packing multiple parameters into a
-# space-separated string is a well documented source of bugs and security
-# problems, so this is (mostly) avoided, by progressively accumulating
-# options in "$@", and eventually passing that to Java.
-#
-# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
-# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
-# see the in-line comments for details.
-#
-# There are tweaks for specific operating systems such as AIX, CygWin,
-# Darwin, MinGW, and NonStop.
-#
-# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
-# within the Gradle project.
-#
-# You can find Gradle at https://github.com/gradle/gradle/.
-#
-##############################################################################
-
-# Attempt to set APP_HOME
-
-# Resolve links: $0 may be a link
-app_path=$0
-
-# Need this for daisy-chained symlinks.
-while
- APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
- [ -h "$app_path" ]
-do
- ls=$( ls -ld "$app_path" )
- link=${ls#*' -> '}
- case $link in #(
- /*) app_path=$link ;; #(
- *) app_path=$APP_HOME$link ;;
- esac
-done
-
-APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
-
-APP_NAME="Gradle"
-APP_BASE_NAME=${0##*/}
-
-# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
-
-# Use the maximum available, or set MAX_FD != -1 to use that value.
-MAX_FD=maximum
-
-warn () {
- echo "$*"
-} >&2
-
-die () {
- echo
- echo "$*"
- echo
- exit 1
-} >&2
-
-# OS specific support (must be 'true' or 'false').
-cygwin=false
-msys=false
-darwin=false
-nonstop=false
-case "$( uname )" in #(
- CYGWIN* ) cygwin=true ;; #(
- Darwin* ) darwin=true ;; #(
- MSYS* | MINGW* ) msys=true ;; #(
- NONSTOP* ) nonstop=true ;;
-esac
-
-CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
-
-
-# Determine the Java command to use to start the JVM.
-if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD=$JAVA_HOME/jre/sh/java
- else
- JAVACMD=$JAVA_HOME/bin/java
- fi
- if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
- fi
-else
- JAVACMD=java
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-
-Please set the JAVA_HOME variable in your environment to match the
-location of your Java installation."
-fi
-
-# Increase the maximum file descriptors if we can.
-if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
- case $MAX_FD in #(
- max*)
- MAX_FD=$( ulimit -H -n ) ||
- warn "Could not query maximum file descriptor limit"
- esac
- case $MAX_FD in #(
- '' | soft) :;; #(
- *)
- ulimit -n "$MAX_FD" ||
- warn "Could not set maximum file descriptor limit to $MAX_FD"
- esac
-fi
-
-# Collect all arguments for the java command, stacking in reverse order:
-# * args from the command line
-# * the main class name
-# * -classpath
-# * -D...appname settings
-# * --module-path (only if needed)
-# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
-
-# For Cygwin or MSYS, switch paths to Windows format before running java
-if "$cygwin" || "$msys" ; then
- APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
- CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
-
- JAVACMD=$( cygpath --unix "$JAVACMD" )
-
- # Now convert the arguments - kludge to limit ourselves to /bin/sh
- for arg do
- if
- case $arg in #(
- -*) false ;; # don't mess with options #(
- /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
- [ -e "$t" ] ;; #(
- *) false ;;
- esac
- then
- arg=$( cygpath --path --ignore --mixed "$arg" )
- fi
- # Roll the args list around exactly as many times as the number of
- # args, so each arg winds up back in the position where it started, but
- # possibly modified.
- #
- # NB: a `for` loop captures its iteration list before it begins, so
- # changing the positional parameters here affects neither the number of
- # iterations, nor the values presented in `arg`.
- shift # remove old arg
- set -- "$@" "$arg" # push replacement arg
- done
-fi
-
-# Collect all arguments for the java command;
-# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
-# shell script including quotes and variable substitutions, so put them in
-# double quotes to make sure that they get re-expanded; and
-# * put everything else in single quotes, so that it's not re-expanded.
-
-set -- \
- "-Dorg.gradle.appname=$APP_BASE_NAME" \
- -classpath "$CLASSPATH" \
- org.gradle.wrapper.GradleWrapperMain \
- "$@"
-
-# Use "xargs" to parse quoted args.
-#
-# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
-#
-# In Bash we could simply go:
-#
-# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
-# set -- "${ARGS[@]}" "$@"
-#
-# but POSIX shell has neither arrays nor command substitution, so instead we
-# post-process each arg (as a line of input to sed) to backslash-escape any
-# character that might be a shell metacharacter, then use eval to reverse
-# that process (while maintaining the separation between arguments), and wrap
-# the whole thing up as a single "set" statement.
-#
-# This will of course break if any of these variables contains a newline or
-# an unmatched quote.
-#
-
-eval "set -- $(
- printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
- xargs -n1 |
- sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
- tr '\n' ' '
- )" '"$@"'
-
-exec "$JAVACMD" "$@"
diff --git a/android/gradlew.bat b/android/gradlew.bat
deleted file mode 100644
index 107acd32..00000000
--- a/android/gradlew.bat
+++ /dev/null
@@ -1,89 +0,0 @@
-@rem
-@rem Copyright 2015 the original author or authors.
-@rem
-@rem Licensed under the Apache License, Version 2.0 (the "License");
-@rem you may not use this file except in compliance with the License.
-@rem You may obtain a copy of the License at
-@rem
-@rem https://www.apache.org/licenses/LICENSE-2.0
-@rem
-@rem Unless required by applicable law or agreed to in writing, software
-@rem distributed under the License is distributed on an "AS IS" BASIS,
-@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-@rem See the License for the specific language governing permissions and
-@rem limitations under the License.
-@rem
-
-@if "%DEBUG%" == "" @echo off
-@rem ##########################################################################
-@rem
-@rem Gradle startup script for Windows
-@rem
-@rem ##########################################################################
-
-@rem Set local scope for the variables with windows NT shell
-if "%OS%"=="Windows_NT" setlocal
-
-set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
-set APP_BASE_NAME=%~n0
-set APP_HOME=%DIRNAME%
-
-@rem Resolve any "." and ".." in APP_HOME to make it shorter.
-for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
-
-@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
-set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
-
-@rem Find java.exe
-if defined JAVA_HOME goto findJavaFromJavaHome
-
-set JAVA_EXE=java.exe
-%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto execute
-
-echo.
-echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:findJavaFromJavaHome
-set JAVA_HOME=%JAVA_HOME:"=%
-set JAVA_EXE=%JAVA_HOME%/bin/java.exe
-
-if exist "%JAVA_EXE%" goto execute
-
-echo.
-echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
-echo.
-echo Please set the JAVA_HOME variable in your environment to match the
-echo location of your Java installation.
-
-goto fail
-
-:execute
-@rem Setup the command line
-
-set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
-
-
-@rem Execute Gradle
-"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
-
-:end
-@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
-
-:fail
-rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
-rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
-
-:mainEnd
-if "%OS%"=="Windows_NT" endlocal
-
-:omega
diff --git a/android/settings.gradle b/android/settings.gradle
deleted file mode 100644
index 74697331..00000000
--- a/android/settings.gradle
+++ /dev/null
@@ -1,9 +0,0 @@
-file('examples').eachDir { sub ->
- if (sub.name != '_template') {
- if (file("examples/$sub.name/build.gradle").exists()) {
- println("Adding project $sub.name")
- include ":$sub.name"
- project(":$sub.name").projectDir = new File("examples/$sub.name")
- }
- }
-}
diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt
index 90112062..69e66e4a 100644
--- a/base/CMakeLists.txt
+++ b/base/CMakeLists.txt
@@ -1,8 +1,31 @@
-# Copyright (c) 2016-2025, Sascha Willems
-# SPDX-License-Identifier: MIT
+# Procedural 3D Engine - Base Library
+# Copyright (c) 2025 Your Project
+# Licensed under the MIT License
+# Based on Vulkan examples by Sascha Willems (MIT License)
-file(GLOB BASE_SRC "*.cpp" "*.hpp" "*.h" "../external/imgui/*.cpp")
-file(GLOB BASE_HEADERS "*.hpp" "*.h")
+file(GLOB_RECURSE BASE_SRC
+ "*.cpp"
+ "*.hpp"
+ "*.h"
+ "device/*.cpp"
+ "device/*.h"
+ "memory/*.cpp"
+ "memory/*.h"
+ "core/*.cpp"
+ "core/*.hpp"
+ "core/*.h"
+ "foundation/*.cpp"
+ "foundation/*.h"
+)
+file(GLOB_RECURSE BASE_HEADERS
+ "*.hpp"
+ "*.h"
+ "device/*.h"
+ "memory/*.h"
+ "core/*.hpp"
+ "core/*.h"
+ "foundation/*.h"
+)
set(KTX_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../external/ktx)
set(KTX_SOURCES
diff --git a/base/VulkanAndroid.cpp b/base/VulkanAndroid.cpp
deleted file mode 100644
index 43d8c1c7..00000000
--- a/base/VulkanAndroid.cpp
+++ /dev/null
@@ -1,366 +0,0 @@
-/*
-* Android Vulkan function pointer loader
-*
-* Copyright (C) 2016-2025 by Sascha Willems - www.saschawillems.de
-*
-* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
-*/
-
-#include "VulkanAndroid.h"
-
-#if defined(__ANDROID__)
- #include
- #include
- #include
-
-android_app* androidApp;
-
-PFN_vkCreateInstance vkCreateInstance;
-PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr;
-PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
-PFN_vkCreateDevice vkCreateDevice;
-PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices;
-PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties;
-PFN_vkGetPhysicalDeviceProperties2 vkGetPhysicalDeviceProperties2;
-PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties;
-PFN_vkEnumerateDeviceLayerProperties vkEnumerateDeviceLayerProperties;
-PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties;
-PFN_vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFeatures;
-PFN_vkGetPhysicalDeviceFeatures2 vkGetPhysicalDeviceFeatures2;
-PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties;
-PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties;
-PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties;
-PFN_vkEnumerateInstanceLayerProperties vkEnumerateInstanceLayerProperties;
-PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier;
-PFN_vkCreateShaderModule vkCreateShaderModule;
-PFN_vkCreateBuffer vkCreateBuffer;
-PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements;
-PFN_vkMapMemory vkMapMemory;
-PFN_vkUnmapMemory vkUnmapMemory;
-PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges;
-PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges;
-PFN_vkBindBufferMemory vkBindBufferMemory;
-PFN_vkDestroyBuffer vkDestroyBuffer;
-PFN_vkAllocateMemory vkAllocateMemory;
-PFN_vkBindImageMemory vkBindImageMemory;
-PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout;
-PFN_vkCmdCopyBuffer vkCmdCopyBuffer;
-PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage;
-PFN_vkCmdCopyImage vkCmdCopyImage;
-PFN_vkCmdBlitImage vkCmdBlitImage;
-PFN_vkCmdClearAttachments vkCmdClearAttachments;
-PFN_vkCreateSampler vkCreateSampler;
-PFN_vkDestroySampler vkDestroySampler;
-PFN_vkDestroyImage vkDestroyImage;
-PFN_vkFreeMemory vkFreeMemory;
-PFN_vkCreateRenderPass vkCreateRenderPass;
-PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass;
-PFN_vkCmdEndRenderPass vkCmdEndRenderPass;
-PFN_vkCmdNextSubpass vkCmdNextSubpass;
-PFN_vkCmdExecuteCommands vkCmdExecuteCommands;
-PFN_vkCmdClearColorImage vkCmdClearColorImage;
-PFN_vkCreateImage vkCreateImage;
-PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements;
-PFN_vkCreateImageView vkCreateImageView;
-PFN_vkDestroyImageView vkDestroyImageView;
-PFN_vkCreateSemaphore vkCreateSemaphore;
-PFN_vkDestroySemaphore vkDestroySemaphore;
-PFN_vkCreateFence vkCreateFence;
-PFN_vkDestroyFence vkDestroyFence;
-PFN_vkWaitForFences vkWaitForFences;
-PFN_vkResetFences vkResetFences;
-PFN_vkResetDescriptorPool vkResetDescriptorPool;
-PFN_vkCreateCommandPool vkCreateCommandPool;
-PFN_vkDestroyCommandPool vkDestroyCommandPool;
-PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers;
-PFN_vkBeginCommandBuffer vkBeginCommandBuffer;
-PFN_vkEndCommandBuffer vkEndCommandBuffer;
-PFN_vkGetDeviceQueue vkGetDeviceQueue;
-PFN_vkQueueSubmit vkQueueSubmit;
-PFN_vkQueueWaitIdle vkQueueWaitIdle;
-PFN_vkDeviceWaitIdle vkDeviceWaitIdle;
-PFN_vkCreateFramebuffer vkCreateFramebuffer;
-PFN_vkCreatePipelineCache vkCreatePipelineCache;
-PFN_vkCreatePipelineLayout vkCreatePipelineLayout;
-PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines;
-PFN_vkCreateComputePipelines vkCreateComputePipelines;
-PFN_vkCreateDescriptorPool vkCreateDescriptorPool;
-PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout;
-PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets;
-PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets;
-PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets;
-PFN_vkCmdBindPipeline vkCmdBindPipeline;
-PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers;
-PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer;
-PFN_vkCmdSetViewport vkCmdSetViewport;
-PFN_vkCmdSetScissor vkCmdSetScissor;
-PFN_vkCmdSetLineWidth vkCmdSetLineWidth;
-PFN_vkCmdSetDepthBias vkCmdSetDepthBias;
-PFN_vkCmdPushConstants vkCmdPushConstants;
-PFN_vkCmdDrawIndexed vkCmdDrawIndexed;
-PFN_vkCmdDraw vkCmdDraw;
-PFN_vkCmdDrawIndexedIndirect vkCmdDrawIndexedIndirect;
-PFN_vkCmdDrawIndirect vkCmdDrawIndirect;
-PFN_vkCmdDispatch vkCmdDispatch;
-PFN_vkDestroyPipeline vkDestroyPipeline;
-PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout;
-PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout;
-PFN_vkDestroyDevice vkDestroyDevice;
-PFN_vkDestroyInstance vkDestroyInstance;
-PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool;
-PFN_vkFreeCommandBuffers vkFreeCommandBuffers;
-PFN_vkDestroyRenderPass vkDestroyRenderPass;
-PFN_vkDestroyFramebuffer vkDestroyFramebuffer;
-PFN_vkDestroyShaderModule vkDestroyShaderModule;
-PFN_vkDestroyPipelineCache vkDestroyPipelineCache;
-PFN_vkCreateQueryPool vkCreateQueryPool;
-PFN_vkDestroyQueryPool vkDestroyQueryPool;
-PFN_vkGetQueryPoolResults vkGetQueryPoolResults;
-PFN_vkCmdBeginQuery vkCmdBeginQuery;
-PFN_vkCmdEndQuery vkCmdEndQuery;
-PFN_vkCmdResetQueryPool vkCmdResetQueryPool;
-PFN_vkCmdCopyQueryPoolResults vkCmdCopyQueryPoolResults;
-PFN_vkGetPhysicalDeviceSparseImageFormatProperties vkGetPhysicalDeviceSparseImageFormatProperties;
-PFN_vkGetImageSparseMemoryRequirements vkGetImageSparseMemoryRequirements;
-PFN_vkQueueBindSparse vkQueueBindSparse;
-PFN_vkCmdBeginRendering vkCmdBeginRendering;
-PFN_vkCmdEndRendering vkCmdEndRendering;
-
-PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR;
-PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR;
-PFN_vkCmdFillBuffer vkCmdFillBuffer;
-
-PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR;
-PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR;
-PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR;
-PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR;
-PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR;
-PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR;
-PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR;
-PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR;
-PFN_vkQueuePresentKHR vkQueuePresentKHR;
-
-PFN_vkResetCommandBuffer vkResetCommandBuffer;
-
-PFN_vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceImageFormatProperties;
-
-int32_t vks::android::screenDensity;
-
-void *libVulkan;
-
-namespace vks
-{
- namespace android
- {
- // Dynamically load Vulkan library and base function pointers
- bool loadVulkanLibrary()
- {
- __android_log_print(ANDROID_LOG_INFO, "vulkanandroid", "Loading libvulkan.so...\n");
-
- // Load vulkan library
- libVulkan = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
- if (!libVulkan)
- {
- __android_log_print(ANDROID_LOG_INFO, "vulkanandroid", "Could not load vulkan library : %s!\n", dlerror());
- return false;
- }
-
- // Load base function pointers
- vkEnumerateInstanceExtensionProperties = reinterpret_cast(dlsym(libVulkan, "vkEnumerateInstanceExtensionProperties"));
- vkEnumerateInstanceLayerProperties = reinterpret_cast(dlsym(libVulkan, "vkEnumerateInstanceLayerProperties"));
- vkCreateInstance = reinterpret_cast(dlsym(libVulkan, "vkCreateInstance"));
- vkGetInstanceProcAddr = reinterpret_cast(dlsym(libVulkan, "vkGetInstanceProcAddr"));
- vkGetDeviceProcAddr = reinterpret_cast(dlsym(libVulkan, "vkGetDeviceProcAddr"));
-
- return true;
- }
-
- // Load instance based Vulkan function pointers
- void loadVulkanFunctions(VkInstance instance)
- {
- __android_log_print(ANDROID_LOG_INFO, "vulkanandroid", "Loading instance based function pointers...\n");
-
- vkEnumeratePhysicalDevices = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkEnumeratePhysicalDevices"));
- vkGetPhysicalDeviceProperties = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceProperties"));
- vkGetPhysicalDeviceProperties2 = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceProperties2"));
- vkEnumerateDeviceLayerProperties = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkEnumerateDeviceLayerProperties"));
- vkEnumerateDeviceExtensionProperties = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkEnumerateDeviceExtensionProperties"));
- vkGetPhysicalDeviceQueueFamilyProperties = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceQueueFamilyProperties"));
- vkGetPhysicalDeviceFeatures = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceFeatures"));
- vkGetPhysicalDeviceFeatures2 = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceFeatures2"));
- vkCreateDevice = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateDevice"));
- vkGetPhysicalDeviceFormatProperties = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceFormatProperties"));
- vkGetPhysicalDeviceMemoryProperties = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceMemoryProperties"));
-
- vkCmdPipelineBarrier = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdPipelineBarrier"));
- vkCreateShaderModule = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateShaderModule"));
-
- vkCreateBuffer = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateBuffer"));
- vkGetBufferMemoryRequirements = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetBufferMemoryRequirements"));
- vkMapMemory = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkMapMemory"));
- vkUnmapMemory = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkUnmapMemory"));
- vkFlushMappedMemoryRanges = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkFlushMappedMemoryRanges"));
- vkInvalidateMappedMemoryRanges = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkInvalidateMappedMemoryRanges"));
- vkBindBufferMemory = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkBindBufferMemory"));
- vkDestroyBuffer = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroyBuffer"));
-
- vkAllocateMemory = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkAllocateMemory"));
- vkFreeMemory = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkFreeMemory"));
- vkCreateRenderPass = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateRenderPass"));
- vkCmdBeginRenderPass = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdBeginRenderPass"));
- vkCmdEndRenderPass = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdEndRenderPass"));
- vkCmdNextSubpass = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdNextSubpass"));
- vkCmdExecuteCommands = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdExecuteCommands"));
- vkCmdClearColorImage = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdClearColorImage"));
-
- vkCreateImage = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateImage"));
- vkGetImageMemoryRequirements = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetImageMemoryRequirements"));
- vkCreateImageView = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateImageView"));
- vkDestroyImageView = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroyImageView"));
- vkBindImageMemory = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkBindImageMemory"));
- vkGetImageSubresourceLayout = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetImageSubresourceLayout"));
- vkCmdCopyImage = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdCopyImage"));
- vkCmdBlitImage = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdBlitImage"));
- vkDestroyImage = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroyImage"));
-
- vkCmdClearAttachments = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdClearAttachments"));
-
- vkCmdCopyBuffer = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdCopyBuffer"));
- vkCmdCopyBufferToImage = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdCopyBufferToImage"));
-
- vkCreateSampler = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateSampler"));
- vkDestroySampler = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroySampler"));;
-
- vkCreateSemaphore = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateSemaphore"));
- vkDestroySemaphore = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroySemaphore"));
-
- vkCreateFence = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateFence"));
- vkDestroyFence = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroyFence"));
- vkWaitForFences = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkWaitForFences"));
- vkResetFences = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkResetFences"));;
- vkResetDescriptorPool = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkResetDescriptorPool"));
-
- vkCreateCommandPool = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateCommandPool"));
- vkDestroyCommandPool = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroyCommandPool"));;
-
- vkAllocateCommandBuffers = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkAllocateCommandBuffers"));
- vkBeginCommandBuffer = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkBeginCommandBuffer"));
- vkEndCommandBuffer = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkEndCommandBuffer"));
-
- vkGetDeviceQueue = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetDeviceQueue"));
- vkQueueSubmit = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkQueueSubmit"));
- vkQueueWaitIdle = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkQueueWaitIdle"));
-
- vkDeviceWaitIdle = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDeviceWaitIdle"));
-
- vkCreateFramebuffer = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateFramebuffer"));
-
- vkCreatePipelineCache = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreatePipelineCache"));
- vkCreatePipelineLayout = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreatePipelineLayout"));
- vkCreateGraphicsPipelines = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateGraphicsPipelines"));
- vkCreateComputePipelines = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateComputePipelines"));
-
- vkCreateDescriptorPool = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateDescriptorPool"));
- vkCreateDescriptorSetLayout = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateDescriptorSetLayout"));
-
- vkAllocateDescriptorSets = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkAllocateDescriptorSets"));
- vkUpdateDescriptorSets = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkUpdateDescriptorSets"));
-
- vkCmdBindDescriptorSets = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdBindDescriptorSets"));
- vkCmdBindPipeline = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdBindPipeline"));
- vkCmdBindVertexBuffers = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdBindVertexBuffers"));
- vkCmdBindIndexBuffer = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdBindIndexBuffer"));
-
- vkCmdSetViewport = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdSetViewport"));
- vkCmdSetScissor = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdSetScissor"));
- vkCmdSetLineWidth = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdSetLineWidth"));
- vkCmdSetDepthBias = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdSetDepthBias"));
- vkCmdPushConstants = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdPushConstants"));;
-
- vkCmdDrawIndexed = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdDrawIndexed"));
- vkCmdDraw = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdDraw"));
- vkCmdDrawIndexedIndirect = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdDrawIndexedIndirect"));
- vkCmdDrawIndirect = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdDrawIndirect"));
- vkCmdDispatch = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdDispatch"));
-
- vkDestroyPipeline = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroyPipeline"));
- vkDestroyPipelineLayout = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroyPipelineLayout"));;
- vkDestroyDescriptorSetLayout = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroyDescriptorSetLayout"));
- vkDestroyDevice = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroyDevice"));
- vkDestroyInstance = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroyInstance"));
- vkDestroyDescriptorPool = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroyDescriptorPool"));
- vkFreeCommandBuffers = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkFreeCommandBuffers"));
- vkDestroyRenderPass = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroyRenderPass"));
- vkDestroyFramebuffer = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroyFramebuffer"));
- vkDestroyShaderModule = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroyShaderModule"));
- vkDestroyPipelineCache = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroyPipelineCache"));
-
- vkCreateQueryPool = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateQueryPool"));
- vkDestroyQueryPool = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroyQueryPool"));
- vkGetQueryPoolResults = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetQueryPoolResults"));
-
- vkCmdBeginQuery = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdBeginQuery"));
- vkCmdEndQuery = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdEndQuery"));
- vkCmdResetQueryPool = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdResetQueryPool"));
- vkCmdCopyQueryPoolResults = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdCopyQueryPoolResults"));
-
- vkGetPhysicalDeviceSparseImageFormatProperties = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceSparseImageFormatProperties"));
- vkGetImageSparseMemoryRequirements = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetImageSparseMemoryRequirements"));
- vkQueueBindSparse = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkQueueBindSparse"));
-
- vkCmdBeginRendering = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdBeginRendering"));
- vkCmdEndRendering = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdEndRendering"));
-
- vkCreateAndroidSurfaceKHR = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateAndroidSurfaceKHR"));
- vkDestroySurfaceKHR = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroySurfaceKHR"));
-
- vkCmdFillBuffer = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCmdFillBuffer"));
-
- vkGetPhysicalDeviceSurfaceSupportKHR = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceSurfaceSupportKHR"));
- vkGetPhysicalDeviceSurfaceCapabilitiesKHR = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceSurfaceCapabilitiesKHR"));
- vkGetPhysicalDeviceSurfaceFormatsKHR = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceSurfaceFormatsKHR"));
- vkGetPhysicalDeviceSurfacePresentModesKHR = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceSurfacePresentModesKHR"));
- vkCreateSwapchainKHR = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateSwapchainKHR"));
- vkDestroySwapchainKHR = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkDestroySwapchainKHR"));
- vkGetSwapchainImagesKHR = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetSwapchainImagesKHR"));
- vkAcquireNextImageKHR = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkAcquireNextImageKHR"));
- vkQueuePresentKHR = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkQueuePresentKHR"));
-
- vkResetCommandBuffer = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkResetCommandBuffer"));
-
- vkGetPhysicalDeviceImageFormatProperties = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkGetPhysicalDeviceImageFormatProperties"));
- }
-
- void freeVulkanLibrary()
- {
- dlclose(libVulkan);
- }
-
- void getDeviceConfig()
- {
- // Screen density
- AConfiguration* config = AConfiguration_new();
- AConfiguration_fromAssetManager(config, androidApp->activity->assetManager);
- vks::android::screenDensity = AConfiguration_getDensity(config);
- AConfiguration_delete(config);
- }
-
- // Displays a native alert dialog using JNI
- void showAlert(const char* message) {
- JNIEnv* jni;
- androidApp->activity->vm->AttachCurrentThread(&jni, NULL);
-
- jstring jmessage = jni->NewStringUTF(message);
-
- jclass clazz = jni->GetObjectClass(androidApp->activity->clazz);
- // Signature has to match java implementation (arguments)
- jmethodID methodID = jni->GetMethodID(clazz, "showAlert", "(Ljava/lang/String;)V");
- jni->CallVoidMethod(androidApp->activity->clazz, methodID, jmessage);
- jni->DeleteLocalRef(jmessage);
-
- androidApp->activity->vm->DetachCurrentThread();
- }
- }
-}
-
-#endif
diff --git a/base/VulkanAndroid.h b/base/VulkanAndroid.h
deleted file mode 100644
index f3201bde..00000000
--- a/base/VulkanAndroid.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
-* Android Vulkan function pointer prototypes
-*
-* Copyright (C) 2016-2025 by Sascha Willems - www.saschawillems.de
-*
-* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
-*/
-
-#pragma once
-
-#ifndef VULKANANDROID_H
-#define VULKANANDROID_H
-
-// Vulkan needs to be loaded dynamically on android
-// While SDK 26 (and up) come with a loader, we also want to support older devices, so we manually load function pointers
-
-#pragma once
-
-#ifndef VULKANANDROID_HPP
-#define VULKANANDROID_HPP
-
-#include "vulkan/vulkan.h"
-
-#if defined(__ANDROID__)
-
-#include
-#include
-#include
-#include
-#include
-
-// Global reference to android application object
-extern android_app* androidApp;
-
-#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "vulkanExample", __VA_ARGS__))
-#define LOGW(...) ((void)__android_log_print(ANDROID_LOG_WARN, "vulkanExample", __VA_ARGS__))
-#define LOGD(...) ((void)__android_log_print(ANDROID_LOG_DEBUG, "vulkanExample", __VA_ARGS__))
-#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, "vulkanExample", __VA_ARGS__))
-
-// Function pointer prototypes
-// Not complete, just the functions used in the caps viewer!
-extern PFN_vkCreateInstance vkCreateInstance;
-extern PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr;
-extern PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr;
-extern PFN_vkCreateDevice vkCreateDevice;
-extern PFN_vkEnumeratePhysicalDevices vkEnumeratePhysicalDevices;
-extern PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties;
-extern PFN_vkGetPhysicalDeviceProperties2 vkGetPhysicalDeviceProperties2;
-extern PFN_vkEnumerateDeviceExtensionProperties vkEnumerateDeviceExtensionProperties;
-extern PFN_vkEnumerateDeviceLayerProperties vkEnumerateDeviceLayerProperties;
-extern PFN_vkGetPhysicalDeviceFormatProperties vkGetPhysicalDeviceFormatProperties;
-extern PFN_vkGetPhysicalDeviceFeatures vkGetPhysicalDeviceFeatures;
-extern PFN_vkGetPhysicalDeviceFeatures2 vkGetPhysicalDeviceFeatures2;
-extern PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties;
-extern PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties;
-extern PFN_vkEnumerateInstanceExtensionProperties vkEnumerateInstanceExtensionProperties;
-extern PFN_vkEnumerateInstanceLayerProperties vkEnumerateInstanceLayerProperties;
-extern PFN_vkCmdPipelineBarrier vkCmdPipelineBarrier;
-extern PFN_vkCreateShaderModule vkCreateShaderModule;
-extern PFN_vkCreateBuffer vkCreateBuffer;
-extern PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements;
-extern PFN_vkMapMemory vkMapMemory;
-extern PFN_vkUnmapMemory vkUnmapMemory;
-extern PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges;
-extern PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges;
-extern PFN_vkBindBufferMemory vkBindBufferMemory;
-extern PFN_vkDestroyBuffer vkDestroyBuffer;
-extern PFN_vkAllocateMemory vkAllocateMemory;
-extern PFN_vkBindImageMemory vkBindImageMemory;
-extern PFN_vkGetImageSubresourceLayout vkGetImageSubresourceLayout;
-extern PFN_vkCmdCopyBuffer vkCmdCopyBuffer;
-extern PFN_vkCmdCopyBufferToImage vkCmdCopyBufferToImage;
-extern PFN_vkCmdCopyImage vkCmdCopyImage;
-extern PFN_vkCmdBlitImage vkCmdBlitImage;
-extern PFN_vkCmdClearAttachments vkCmdClearAttachments;
-extern PFN_vkCreateSampler vkCreateSampler;
-extern PFN_vkDestroySampler vkDestroySampler;
-extern PFN_vkDestroyImage vkDestroyImage;
-extern PFN_vkFreeMemory vkFreeMemory;
-extern PFN_vkCreateRenderPass vkCreateRenderPass;
-extern PFN_vkCmdBeginRenderPass vkCmdBeginRenderPass;
-extern PFN_vkCmdEndRenderPass vkCmdEndRenderPass;
-extern PFN_vkCmdNextSubpass vkCmdNextSubpass;
-extern PFN_vkCmdExecuteCommands vkCmdExecuteCommands;
-extern PFN_vkCmdClearColorImage vkCmdClearColorImage;
-extern PFN_vkCreateImage vkCreateImage;
-extern PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements;
-extern PFN_vkCreateImageView vkCreateImageView;
-extern PFN_vkDestroyImageView vkDestroyImageView;
-extern PFN_vkCreateSemaphore vkCreateSemaphore;
-extern PFN_vkDestroySemaphore vkDestroySemaphore;
-extern PFN_vkCreateFence vkCreateFence;
-extern PFN_vkDestroyFence vkDestroyFence;
-extern PFN_vkWaitForFences vkWaitForFences;
-extern PFN_vkResetFences vkResetFences;
-extern PFN_vkResetDescriptorPool vkResetDescriptorPool;
-extern PFN_vkCreateCommandPool vkCreateCommandPool;
-extern PFN_vkDestroyCommandPool vkDestroyCommandPool;
-extern PFN_vkAllocateCommandBuffers vkAllocateCommandBuffers;
-extern PFN_vkBeginCommandBuffer vkBeginCommandBuffer;
-extern PFN_vkEndCommandBuffer vkEndCommandBuffer;
-extern PFN_vkGetDeviceQueue vkGetDeviceQueue;
-extern PFN_vkQueueSubmit vkQueueSubmit;
-extern PFN_vkQueueWaitIdle vkQueueWaitIdle;
-extern PFN_vkDeviceWaitIdle vkDeviceWaitIdle;
-extern PFN_vkCreateFramebuffer vkCreateFramebuffer;
-extern PFN_vkCreatePipelineCache vkCreatePipelineCache;
-extern PFN_vkCreatePipelineLayout vkCreatePipelineLayout;
-extern PFN_vkCreateGraphicsPipelines vkCreateGraphicsPipelines;
-extern PFN_vkCreateComputePipelines vkCreateComputePipelines;
-extern PFN_vkCreateDescriptorPool vkCreateDescriptorPool;
-extern PFN_vkCreateDescriptorSetLayout vkCreateDescriptorSetLayout;
-extern PFN_vkAllocateDescriptorSets vkAllocateDescriptorSets;
-extern PFN_vkUpdateDescriptorSets vkUpdateDescriptorSets;
-extern PFN_vkCmdBindDescriptorSets vkCmdBindDescriptorSets;
-extern PFN_vkCmdBindPipeline vkCmdBindPipeline;
-extern PFN_vkCmdBindVertexBuffers vkCmdBindVertexBuffers;
-extern PFN_vkCmdBindIndexBuffer vkCmdBindIndexBuffer;
-extern PFN_vkCmdSetViewport vkCmdSetViewport;
-extern PFN_vkCmdSetScissor vkCmdSetScissor;
-extern PFN_vkCmdSetLineWidth vkCmdSetLineWidth;
-extern PFN_vkCmdSetDepthBias vkCmdSetDepthBias;
-extern PFN_vkCmdPushConstants vkCmdPushConstants;
-extern PFN_vkCmdDrawIndexed vkCmdDrawIndexed;
-extern PFN_vkCmdDraw vkCmdDraw;
-extern PFN_vkCmdDrawIndexedIndirect vkCmdDrawIndexedIndirect;
-extern PFN_vkCmdDrawIndirect vkCmdDrawIndirect;
-extern PFN_vkCmdDispatch vkCmdDispatch;
-extern PFN_vkDestroyPipeline vkDestroyPipeline;
-extern PFN_vkDestroyPipelineLayout vkDestroyPipelineLayout;
-extern PFN_vkDestroyDescriptorSetLayout vkDestroyDescriptorSetLayout;
-extern PFN_vkDestroyDevice vkDestroyDevice;
-extern PFN_vkDestroyInstance vkDestroyInstance;
-extern PFN_vkDestroyDescriptorPool vkDestroyDescriptorPool;
-extern PFN_vkFreeCommandBuffers vkFreeCommandBuffers;
-extern PFN_vkDestroyRenderPass vkDestroyRenderPass;
-extern PFN_vkDestroyFramebuffer vkDestroyFramebuffer;
-extern PFN_vkDestroyShaderModule vkDestroyShaderModule;
-extern PFN_vkDestroyPipelineCache vkDestroyPipelineCache;
-extern PFN_vkCreateQueryPool vkCreateQueryPool;
-extern PFN_vkDestroyQueryPool vkDestroyQueryPool;
-extern PFN_vkGetQueryPoolResults vkGetQueryPoolResults;
-extern PFN_vkCmdBeginQuery vkCmdBeginQuery;
-extern PFN_vkCmdEndQuery vkCmdEndQuery;
-extern PFN_vkCmdResetQueryPool vkCmdResetQueryPool;
-extern PFN_vkCmdCopyQueryPoolResults vkCmdCopyQueryPoolResults;
-extern PFN_vkGetPhysicalDeviceSparseImageFormatProperties vkGetPhysicalDeviceSparseImageFormatProperties;
-extern PFN_vkGetImageSparseMemoryRequirements vkGetImageSparseMemoryRequirements;
-extern PFN_vkQueueBindSparse vkQueueBindSparse;
-extern PFN_vkCmdBeginRendering vkCmdBeginRendering;
-extern PFN_vkCmdEndRendering vkCmdEndRendering;
-
-extern PFN_vkCreateAndroidSurfaceKHR vkCreateAndroidSurfaceKHR;
-extern PFN_vkDestroySurfaceKHR vkDestroySurfaceKHR;
-extern PFN_vkCmdFillBuffer vkCmdFillBuffer;
-
-extern PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR;
-extern PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR;
-extern PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR;
-extern PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetPhysicalDeviceSurfacePresentModesKHR;
-extern PFN_vkCreateSwapchainKHR vkCreateSwapchainKHR;
-extern PFN_vkDestroySwapchainKHR vkDestroySwapchainKHR;
-extern PFN_vkGetSwapchainImagesKHR vkGetSwapchainImagesKHR;
-extern PFN_vkAcquireNextImageKHR vkAcquireNextImageKHR;
-extern PFN_vkQueuePresentKHR vkQueuePresentKHR;
-
-extern PFN_vkResetCommandBuffer vkResetCommandBuffer;
-
-extern PFN_vkGetPhysicalDeviceImageFormatProperties vkGetPhysicalDeviceImageFormatProperties;
-
-namespace vks
-{
- namespace android
- {
- /* @brief Touch control thresholds from Android NDK samples */
- const int32_t DOUBLE_TAP_TIMEOUT = 300 * 1000000;
- const int32_t TAP_TIMEOUT = 180 * 1000000;
- const int32_t DOUBLE_TAP_SLOP = 100;
- const int32_t TAP_SLOP = 8;
-
- /** @brief Density of the device screen (in DPI) */
- extern int32_t screenDensity;
-
- bool loadVulkanLibrary();
- void loadVulkanFunctions(VkInstance instance);
- void freeVulkanLibrary();
- void getDeviceConfig();
- void showAlert(const char* message);
- }
-}
-
-#endif
-
-#endif // VULKANANDROID_HPP
-
-
-#endif // VULKANANDROID_H
-
\ No newline at end of file
diff --git a/base/VulkanFrameBuffer.hpp b/base/VulkanFrameBuffer.hpp
index d21c02cd..9e420a4a 100644
--- a/base/VulkanFrameBuffer.hpp
+++ b/base/VulkanFrameBuffer.hpp
@@ -12,8 +12,8 @@
#include
#include
#include "vulkan/vulkan.h"
-#include "VulkanDevice.h"
-#include "VulkanTools.h"
+#include "device/VulkanDevice.h"
+#include "core/VulkanTools.h"
namespace vks
{
diff --git a/base/VulkanRaytracingSample.h b/base/VulkanRaytracingSample.h
index 08b57e29..bcbaa46d 100644
--- a/base/VulkanRaytracingSample.h
+++ b/base/VulkanRaytracingSample.h
@@ -9,9 +9,9 @@
#pragma once
#include "vulkan/vulkan.h"
-#include "vulkanexamplebase.h"
-#include "VulkanTools.h"
-#include "VulkanDevice.h"
+#include "foundation/vulkanexamplebase.h"
+#include "core/VulkanTools.h"
+#include "device/VulkanDevice.h"
class VulkanRaytracingSample : public VulkanExampleBase
{
diff --git a/base/VulkanglTFModel.h b/base/VulkanglTFModel.h
index 4aad677b..3bfd6fe8 100644
--- a/base/VulkanglTFModel.h
+++ b/base/VulkanglTFModel.h
@@ -21,7 +21,7 @@
#include
#include "vulkan/vulkan.h"
-#include "VulkanDevice.h"
+#include "device/VulkanDevice.h"
#include
#include
diff --git a/base/camera.hpp b/base/camera.hpp
index 4838bde2..4fe9a4b9 100644
--- a/base/camera.hpp
+++ b/base/camera.hpp
@@ -22,29 +22,39 @@ private:
{
glm::mat4 currentMatrix = matrices.view;
- glm::mat4 rotM = glm::mat4(1.0f);
- glm::mat4 transM;
+ if (useOrbitMode && type == CameraType::lookat) {
+ // Orbit mode: position camera relative to orbit center using spherical coordinates
+ updateOrbitPosition();
+
+ // Use lookAt matrix for orbit mode
+ matrices.view = glm::lookAt(position, orbitCenter, glm::vec3(0.0f, 1.0f, 0.0f));
+ viewPos = glm::vec4(position, 0.0f) * glm::vec4(-1.0f, 1.0f, -1.0f, 1.0f);
+ } else {
+ // Standard Sascha camera behavior
+ glm::mat4 rotM = glm::mat4(1.0f);
+ glm::mat4 transM;
- rotM = glm::rotate(rotM, glm::radians(rotation.x * (flipY ? -1.0f : 1.0f)), glm::vec3(1.0f, 0.0f, 0.0f));
- rotM = glm::rotate(rotM, glm::radians(rotation.y), glm::vec3(0.0f, 1.0f, 0.0f));
- rotM = glm::rotate(rotM, glm::radians(rotation.z), glm::vec3(0.0f, 0.0f, 1.0f));
+ rotM = glm::rotate(rotM, glm::radians(rotation.x * (flipY ? -1.0f : 1.0f)), glm::vec3(1.0f, 0.0f, 0.0f));
+ rotM = glm::rotate(rotM, glm::radians(rotation.y), glm::vec3(0.0f, 1.0f, 0.0f));
+ rotM = glm::rotate(rotM, glm::radians(rotation.z), glm::vec3(0.0f, 0.0f, 1.0f));
- glm::vec3 translation = position;
- if (flipY) {
- translation.y *= -1.0f;
+ glm::vec3 translation = position;
+ if (flipY) {
+ translation.y *= -1.0f;
+ }
+ transM = glm::translate(glm::mat4(1.0f), translation);
+
+ if (type == CameraType::firstperson)
+ {
+ matrices.view = rotM * transM;
+ }
+ else
+ {
+ matrices.view = transM * rotM;
+ }
+
+ viewPos = glm::vec4(position, 0.0f) * glm::vec4(-1.0f, 1.0f, -1.0f, 1.0f);
}
- transM = glm::translate(glm::mat4(1.0f), translation);
-
- if (type == CameraType::firstperson)
- {
- matrices.view = rotM * transM;
- }
- else
- {
- matrices.view = transM * rotM;
- }
-
- viewPos = glm::vec4(position, 0.0f) * glm::vec4(-1.0f, 1.0f, -1.0f, 1.0f);
if (matrices.view != currentMatrix) {
updated = true;
@@ -58,6 +68,11 @@ public:
glm::vec3 position = glm::vec3();
glm::vec4 viewPos = glm::vec4();
+ // Orbit camera support
+ glm::vec3 orbitCenter = glm::vec3(0.0f);
+ float orbitDistance = 8.0f;
+ bool useOrbitMode = false;
+
float rotationSpeed = 1.0f;
float movementSpeed = 1.0f;
@@ -158,6 +173,61 @@ public:
this->movementSpeed = movementSpeed;
}
+ // Update camera position based on orbit center and current rotation
+ void updateOrbitPosition()
+ {
+ if (!useOrbitMode) return;
+
+ // Convert Euler angles to spherical coordinates around orbit center
+ float pitch = glm::radians(rotation.x);
+ float yaw = glm::radians(rotation.y);
+
+ // Calculate position relative to orbit center using spherical coordinates
+ float x = orbitDistance * cos(pitch) * cos(yaw);
+ float y = orbitDistance * sin(pitch);
+ float z = orbitDistance * cos(pitch) * sin(yaw);
+
+ position = orbitCenter + glm::vec3(x, y, z);
+ }
+
+ // Enable orbit mode and set orbit center
+ void setOrbitMode(glm::vec3 center, float distance)
+ {
+ orbitCenter = center;
+ orbitDistance = distance;
+ useOrbitMode = true;
+ updateViewMatrix();
+ }
+
+ // Disable orbit mode and return to standard camera
+ void disableOrbitMode()
+ {
+ useOrbitMode = false;
+ updateViewMatrix();
+ }
+
+ // Focus camera on an object using orbit mode
+ void focusOnObject(glm::vec3 objectCenter, float objectRadius)
+ {
+ // Calculate optimal viewing distance based on object radius and FOV
+ float halfFovRadians = glm::radians(fov * 0.5f);
+ float distance = objectRadius / glm::tan(halfFovRadians) * 2.5f;
+ distance = glm::max(distance, objectRadius * 3.0f);
+
+ // Set orbit center to the object center
+ orbitCenter = objectCenter;
+ orbitDistance = distance;
+ useOrbitMode = true;
+
+ // Set camera to a good viewing angle (slightly elevated and angled)
+ rotation.x = 15.0f; // Slight elevation
+ rotation.y = 30.0f; // Angled view
+ rotation.z = 0.0f;
+
+ // Update position and view matrix
+ updateViewMatrix();
+ }
+
void update(float deltaTime)
{
updated = false;
diff --git a/base/VulkanDebug.cpp b/base/core/VulkanDebug.cpp
similarity index 100%
rename from base/VulkanDebug.cpp
rename to base/core/VulkanDebug.cpp
diff --git a/base/VulkanDebug.h b/base/core/VulkanDebug.h
similarity index 100%
rename from base/VulkanDebug.h
rename to base/core/VulkanDebug.h
diff --git a/base/VulkanInitializers.hpp b/base/core/VulkanInitializers.hpp
similarity index 100%
rename from base/VulkanInitializers.hpp
rename to base/core/VulkanInitializers.hpp
diff --git a/base/VulkanTools.cpp b/base/core/VulkanTools.cpp
similarity index 100%
rename from base/VulkanTools.cpp
rename to base/core/VulkanTools.cpp
diff --git a/base/VulkanTools.h b/base/core/VulkanTools.h
similarity index 100%
rename from base/VulkanTools.h
rename to base/core/VulkanTools.h
diff --git a/base/VulkanDevice.cpp b/base/device/VulkanDevice.cpp
similarity index 99%
rename from base/VulkanDevice.cpp
rename to base/device/VulkanDevice.cpp
index 8c1e9755..f76aca3a 100644
--- a/base/VulkanDevice.cpp
+++ b/base/device/VulkanDevice.cpp
@@ -12,7 +12,7 @@
// SRS - Enable beta extensions and make VK_KHR_portability_subset visible
#define VK_ENABLE_BETA_EXTENSIONS
#endif
-#include
+#include "VulkanDevice.h"
#include
namespace vks
diff --git a/base/VulkanDevice.h b/base/device/VulkanDevice.h
similarity index 97%
rename from base/VulkanDevice.h
rename to base/device/VulkanDevice.h
index 87597687..70d1f739 100644
--- a/base/VulkanDevice.h
+++ b/base/device/VulkanDevice.h
@@ -10,8 +10,8 @@
#pragma once
-#include "VulkanBuffer.h"
-#include "VulkanTools.h"
+#include "../memory/VulkanBuffer.h"
+#include "../core/VulkanTools.h"
#include "vulkan/vulkan.h"
#include
#include
diff --git a/base/VulkanSwapChain.cpp b/base/device/VulkanSwapChain.cpp
similarity index 100%
rename from base/VulkanSwapChain.cpp
rename to base/device/VulkanSwapChain.cpp
diff --git a/base/VulkanSwapChain.h b/base/device/VulkanSwapChain.h
similarity index 99%
rename from base/VulkanSwapChain.h
rename to base/device/VulkanSwapChain.h
index cb1386a3..aa252972 100644
--- a/base/VulkanSwapChain.h
+++ b/base/device/VulkanSwapChain.h
@@ -17,7 +17,7 @@
#include
#include
-#include "VulkanTools.h"
+#include "../core/VulkanTools.h"
#ifdef __ANDROID__
#include "VulkanAndroid.h"
diff --git a/base/VulkanUIOverlay.cpp b/base/foundation/VulkanUIOverlay.cpp
similarity index 100%
rename from base/VulkanUIOverlay.cpp
rename to base/foundation/VulkanUIOverlay.cpp
diff --git a/base/VulkanUIOverlay.h b/base/foundation/VulkanUIOverlay.h
similarity index 94%
rename from base/VulkanUIOverlay.h
rename to base/foundation/VulkanUIOverlay.h
index 1a4bf557..ee6730b9 100644
--- a/base/VulkanUIOverlay.h
+++ b/base/foundation/VulkanUIOverlay.h
@@ -17,10 +17,10 @@
#include
#include
-#include "VulkanTools.h"
-#include "VulkanDebug.h"
-#include "VulkanBuffer.h"
-#include "VulkanDevice.h"
+#include "../core/VulkanTools.h"
+#include "../core/VulkanDebug.h"
+#include "../memory/VulkanBuffer.h"
+#include "../device/VulkanDevice.h"
#include "../external/imgui/imgui.h"
diff --git a/base/vulkanexamplebase.cpp b/base/foundation/vulkanexamplebase.cpp
similarity index 99%
rename from base/vulkanexamplebase.cpp
rename to base/foundation/vulkanexamplebase.cpp
index 87b3fde0..b08330b0 100644
--- a/base/vulkanexamplebase.cpp
+++ b/base/foundation/vulkanexamplebase.cpp
@@ -1304,7 +1304,7 @@ HWND VulkanExampleBase::setupWindow(HINSTANCE hinstance, WNDPROC wndproc)
SetWindowPos(window, 0, x, y, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
}
- ShowWindow(window, SW_SHOW);
+ ShowWindow(window, SW_MAXIMIZE);
SetForegroundWindow(window);
SetFocus(window);
diff --git a/base/vulkanexamplebase.h b/base/foundation/vulkanexamplebase.h
similarity index 97%
rename from base/vulkanexamplebase.h
rename to base/foundation/vulkanexamplebase.h
index 7f742be5..40cba822 100644
--- a/base/vulkanexamplebase.h
+++ b/base/foundation/vulkanexamplebase.h
@@ -9,7 +9,8 @@
#pragma once
#ifdef _WIN32
-#pragma comment(linker, "/subsystem:windows")
+// Note: Removed /subsystem:windows pragma to allow console applications
+// #pragma comment(linker, "/subsystem:windows")
#include
#include
#include
@@ -63,17 +64,17 @@
#include "CommandLineParser.hpp"
#include "keycodes.hpp"
-#include "VulkanTools.h"
-#include "VulkanDebug.h"
+#include "../core/VulkanTools.h"
+#include "../core/VulkanDebug.h"
#include "VulkanUIOverlay.h"
-#include "VulkanSwapChain.h"
-#include "VulkanBuffer.h"
-#include "VulkanDevice.h"
-#include "VulkanTexture.h"
+#include "../device/VulkanSwapChain.h"
+#include "../memory/VulkanBuffer.h"
+#include "../device/VulkanDevice.h"
+#include "../memory/VulkanTexture.h"
-#include "VulkanInitializers.hpp"
-#include "camera.hpp"
-#include "benchmark.hpp"
+#include "../core/VulkanInitializers.hpp"
+#include "../camera.hpp"
+#include "../benchmark.hpp"
class VulkanExampleBase
{
@@ -163,8 +164,8 @@ public:
bool prepared = false;
bool resized = false;
bool viewUpdated = false;
- uint32_t width = 1280;
- uint32_t height = 720;
+ uint32_t width = 1920;
+ uint32_t height = 1080;
vks::UIOverlay ui;
CommandLineParser commandLineParser;
diff --git a/base/VulkanBuffer.cpp b/base/memory/VulkanBuffer.cpp
similarity index 100%
rename from base/VulkanBuffer.cpp
rename to base/memory/VulkanBuffer.cpp
diff --git a/base/VulkanBuffer.h b/base/memory/VulkanBuffer.h
similarity index 97%
rename from base/VulkanBuffer.h
rename to base/memory/VulkanBuffer.h
index bd2a421f..c2e4468a 100644
--- a/base/VulkanBuffer.h
+++ b/base/memory/VulkanBuffer.h
@@ -13,7 +13,7 @@
#include
#include "vulkan/vulkan.h"
-#include "VulkanTools.h"
+#include "../core/VulkanTools.h"
namespace vks
{
diff --git a/base/VulkanTexture.cpp b/base/memory/VulkanTexture.cpp
similarity index 99%
rename from base/VulkanTexture.cpp
rename to base/memory/VulkanTexture.cpp
index 01093b07..6e107ac5 100644
--- a/base/VulkanTexture.cpp
+++ b/base/memory/VulkanTexture.cpp
@@ -6,7 +6,7 @@
* This code is licensed under the MIT license(MIT) (http://opensource.org/licenses/MIT)
*/
-#include
+#include "VulkanTexture.h"
namespace vks
{
diff --git a/base/VulkanTexture.h b/base/memory/VulkanTexture.h
similarity index 97%
rename from base/VulkanTexture.h
rename to base/memory/VulkanTexture.h
index 09cf56f2..1601dec7 100644
--- a/base/VulkanTexture.h
+++ b/base/memory/VulkanTexture.h
@@ -19,8 +19,8 @@
#include
#include "VulkanBuffer.h"
-#include "VulkanDevice.h"
-#include "VulkanTools.h"
+#include "../device/VulkanDevice.h"
+#include "../core/VulkanTools.h"
#if defined(__ANDROID__)
# include
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index baf7e7fa..c6f8ca88 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -87,100 +87,7 @@ function(buildExamples)
endfunction(buildExamples)
set(EXAMPLES
- bloom
- bufferdeviceaddress
- computecloth
- computecullandlod
- computeheadless
- computenbody
- computeparticles
- computeraytracing
- computeshader
- conditionalrender
- conservativeraster
- debugprintf
- debugutils
- deferred
- deferredmultisampling
- deferredshadows
- descriptorbuffer
- descriptorindexing
- descriptorsets
- displacement
- distancefieldfonts
- dynamicrendering
- dynamicrenderingmultisampling
- dynamicstate
- dynamicuniformbuffer
- gears
- geometryshader
- gltfloading
- gltfscenerendering
- gltfskinning
- graphicspipelinelibrary
- hdr
- hostimagecopy
imgui
- indirectdraw
- inlineuniformblocks
- inputattachments
- instancing
- meshshader
- multisampling
- multithreading
- multiview
- negativeviewportheight
- occlusionquery
- offscreen
- oit
- parallaxmapping
- particlesystem
- pbrbasic
- pbribl
- pbrtexture
- pipelines
- pipelinestatistics
- pushconstants
- pushdescriptors
- radialblur
- rayquery
- raytracingbasic
- raytracingcallable
- raytracinggltf
- raytracingintersection
- raytracingreflections
- raytracingpositionfetch
- raytracingsbtdata
- raytracingshadows
- raytracingtextures
- renderheadless
- screenshot
- shaderobjects
- shadowmapping
- shadowmappingomni
- shadowmappingcascade
- specializationconstants
- sphericalenvmapping
- ssao
- stencilbuffer
- subpasses
- terraintessellation
- tessellation
- textoverlay
- texture
- texture3d
- texturearray
- texturecubemap
- texturecubemaparray
- texturemipmapgen
- texturesparseresidency
- timelinesemaphore
- triangle
- trianglevulkan13
- variablerateshading
- vertexattributes
- viewportarray
- vulkanscene
)
buildExamples()
diff --git a/examples/bloom/bloom.cpp b/examples/bloom/bloom.cpp
deleted file mode 100644
index b4b27560..00000000
--- a/examples/bloom/bloom.cpp
+++ /dev/null
@@ -1,727 +0,0 @@
-/*
-* Vulkan Example - Implements a separable two-pass fullscreen blur (also known as bloom)
-*
-* Copyright (C) 2016 - 2023 Sascha Willems - www.saschawillems.de
-*
-* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
-*/
-
-#include "vulkanexamplebase.h"
-#include "VulkanglTFModel.h"
-
-
-// Offscreen frame buffer properties
-#define FB_DIM 256
-#define FB_COLOR_FORMAT VK_FORMAT_R8G8B8A8_UNORM
-
-class VulkanExample : public VulkanExampleBase
-{
-public:
- bool bloom = true;
-
- vks::TextureCubeMap cubemap;
-
- struct {
- vkglTF::Model ufo;
- vkglTF::Model ufoGlow;
- vkglTF::Model skyBox;
- } models;
-
- struct {
- vks::Buffer scene;
- vks::Buffer skyBox;
- vks::Buffer blurParams;
- } uniformBuffers;
-
- struct UBO {
- glm::mat4 projection;
- glm::mat4 view;
- glm::mat4 model;
- };
-
- struct UBOBlurParams {
- float blurScale = 1.0f;
- float blurStrength = 1.5f;
- };
-
- struct {
- UBO scene, skyBox;
- UBOBlurParams blurParams;
- } ubos;
-
- struct {
- VkPipeline blurVert;
- VkPipeline blurHorz;
- VkPipeline glowPass;
- VkPipeline phongPass;
- VkPipeline skyBox;
- } pipelines;
-
- struct {
- VkPipelineLayout blur;
- VkPipelineLayout scene;
- } pipelineLayouts;
-
- struct {
- VkDescriptorSet blurVert;
- VkDescriptorSet blurHorz;
- VkDescriptorSet scene;
- VkDescriptorSet skyBox;
- } descriptorSets;
-
- struct {
- VkDescriptorSetLayout blur;
- VkDescriptorSetLayout scene;
- } descriptorSetLayouts;
-
- // Framebuffer for offscreen rendering
- struct FrameBufferAttachment {
- VkImage image;
- VkDeviceMemory mem;
- VkImageView view;
- };
- struct FrameBuffer {
- VkFramebuffer framebuffer;
- FrameBufferAttachment color, depth;
- VkDescriptorImageInfo descriptor;
- };
- struct OffscreenPass {
- int32_t width, height;
- VkRenderPass renderPass;
- VkSampler sampler;
- std::array framebuffers;
- } offscreenPass;
-
- VulkanExample() : VulkanExampleBase()
- {
- title = "Bloom (offscreen rendering)";
- timerSpeed *= 0.5f;
- camera.type = Camera::CameraType::lookat;
- camera.setPosition(glm::vec3(0.0f, 0.0f, -10.25f));
- camera.setRotation(glm::vec3(7.5f, -343.0f, 0.0f));
- camera.setPerspective(45.0f, (float)width / (float)height, 0.1f, 256.0f);
- }
-
- ~VulkanExample()
- {
- // Clean up used Vulkan resources
- // Note : Inherited destructor cleans up resources stored in base class
-
- vkDestroySampler(device, offscreenPass.sampler, nullptr);
-
- // Frame buffer
- for (auto& framebuffer : offscreenPass.framebuffers)
- {
- // Attachments
- vkDestroyImageView(device, framebuffer.color.view, nullptr);
- vkDestroyImage(device, framebuffer.color.image, nullptr);
- vkFreeMemory(device, framebuffer.color.mem, nullptr);
- vkDestroyImageView(device, framebuffer.depth.view, nullptr);
- vkDestroyImage(device, framebuffer.depth.image, nullptr);
- vkFreeMemory(device, framebuffer.depth.mem, nullptr);
-
- vkDestroyFramebuffer(device, framebuffer.framebuffer, nullptr);
- }
- vkDestroyRenderPass(device, offscreenPass.renderPass, nullptr);
-
- vkDestroyPipeline(device, pipelines.blurHorz, nullptr);
- vkDestroyPipeline(device, pipelines.blurVert, nullptr);
- vkDestroyPipeline(device, pipelines.phongPass, nullptr);
- vkDestroyPipeline(device, pipelines.glowPass, nullptr);
- vkDestroyPipeline(device, pipelines.skyBox, nullptr);
-
- vkDestroyPipelineLayout(device, pipelineLayouts.blur , nullptr);
- vkDestroyPipelineLayout(device, pipelineLayouts.scene, nullptr);
-
- vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.blur, nullptr);
- vkDestroyDescriptorSetLayout(device, descriptorSetLayouts.scene, nullptr);
-
- // Uniform buffers
- uniformBuffers.scene.destroy();
- uniformBuffers.skyBox.destroy();
- uniformBuffers.blurParams.destroy();
-
- cubemap.destroy();
- }
-
- // Setup the offscreen framebuffer for rendering the mirrored scene
- // The color attachment of this framebuffer will then be sampled from
- void prepareOffscreenFramebuffer(FrameBuffer *frameBuf, VkFormat colorFormat, VkFormat depthFormat)
- {
- // Color attachment
- VkImageCreateInfo image = vks::initializers::imageCreateInfo();
- image.imageType = VK_IMAGE_TYPE_2D;
- image.format = colorFormat;
- image.extent.width = FB_DIM;
- image.extent.height = FB_DIM;
- image.extent.depth = 1;
- image.mipLevels = 1;
- image.arrayLayers = 1;
- image.samples = VK_SAMPLE_COUNT_1_BIT;
- image.tiling = VK_IMAGE_TILING_OPTIMAL;
- // We will sample directly from the color attachment
- image.usage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_SAMPLED_BIT;
-
- VkMemoryAllocateInfo memAlloc = vks::initializers::memoryAllocateInfo();
- VkMemoryRequirements memReqs;
-
- VkImageViewCreateInfo colorImageView = vks::initializers::imageViewCreateInfo();
- colorImageView.viewType = VK_IMAGE_VIEW_TYPE_2D;
- colorImageView.format = colorFormat;
- colorImageView.flags = 0;
- colorImageView.subresourceRange = {};
- colorImageView.subresourceRange.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
- colorImageView.subresourceRange.baseMipLevel = 0;
- colorImageView.subresourceRange.levelCount = 1;
- colorImageView.subresourceRange.baseArrayLayer = 0;
- colorImageView.subresourceRange.layerCount = 1;
-
- VK_CHECK_RESULT(vkCreateImage(device, &image, nullptr, &frameBuf->color.image));
- vkGetImageMemoryRequirements(device, frameBuf->color.image, &memReqs);
- memAlloc.allocationSize = memReqs.size;
- memAlloc.memoryTypeIndex = vulkanDevice->getMemoryType(memReqs.memoryTypeBits, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
- VK_CHECK_RESULT(vkAllocateMemory(device, &memAlloc, nullptr, &frameBuf->color.mem));
- VK_CHECK_RESULT(vkBindImageMemory(device, frameBuf->color.image, frameBuf->color.mem, 0));
-
- colorImageView.image = frameBuf->color.image;
- VK_CHECK_RESULT(vkCreateImageView(device, &colorImageView, nullptr, &frameBuf->color.view));
-
- // Depth stencil attachment
- image.format = depthFormat;
- image.usage = VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
-
- VkImageViewCreateInfo depthStencilView = vks::initializers::imageViewCreateInfo();
- depthStencilView.viewType = VK_IMAGE_VIEW_TYPE_2D;
- depthStencilView.format = depthFormat;
- depthStencilView.flags = 0;
- depthStencilView.subresourceRange = {};
- depthStencilView.subresourceRange.aspectMask = VK_IMAGE_ASPECT_DEPTH_BIT;
- if (vks::tools::formatHasStencil(depthFormat)) {
- depthStencilView.subresourceRange.aspectMask |= VK_IMAGE_ASPECT_STENCIL_BIT;
- }
- depthStencilView.subresourceRange.baseMipLevel = 0;
- depthStencilView.subresourceRange.levelCount = 1;
- depthStencilView.subresourceRange.baseArrayLayer = 0;
- depthStencilView.subresourceRange.layerCount = 1;
-
- VK_CHECK_RESULT(vkCreateImage(device, &image, nullptr, &frameBuf->depth.image));
- vkGetImageMemoryRequirements(device, frameBuf->depth.image, &memReqs);
- memAlloc.allocationSize = memReqs.size;
- memAlloc.memoryTypeIndex = vulkanDevice->getMemoryType(memReqs.memoryTypeBits, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
- VK_CHECK_RESULT(vkAllocateMemory(device, &memAlloc, nullptr, &frameBuf->depth.mem));
- VK_CHECK_RESULT(vkBindImageMemory(device, frameBuf->depth.image, frameBuf->depth.mem, 0));
-
- depthStencilView.image = frameBuf->depth.image;
- VK_CHECK_RESULT(vkCreateImageView(device, &depthStencilView, nullptr, &frameBuf->depth.view));
-
- VkImageView attachments[2];
- attachments[0] = frameBuf->color.view;
- attachments[1] = frameBuf->depth.view;
-
- VkFramebufferCreateInfo fbufCreateInfo = vks::initializers::framebufferCreateInfo();
- fbufCreateInfo.renderPass = offscreenPass.renderPass;
- fbufCreateInfo.attachmentCount = 2;
- fbufCreateInfo.pAttachments = attachments;
- fbufCreateInfo.width = FB_DIM;
- fbufCreateInfo.height = FB_DIM;
- fbufCreateInfo.layers = 1;
-
- VK_CHECK_RESULT(vkCreateFramebuffer(device, &fbufCreateInfo, nullptr, &frameBuf->framebuffer));
-
- // Fill a descriptor for later use in a descriptor set
- frameBuf->descriptor.imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
- frameBuf->descriptor.imageView = frameBuf->color.view;
- frameBuf->descriptor.sampler = offscreenPass.sampler;
- }
-
- // Prepare the offscreen framebuffers used for the vertical- and horizontal blur
- void prepareOffscreen()
- {
- offscreenPass.width = FB_DIM;
- offscreenPass.height = FB_DIM;
-
- // Find a suitable depth format
- VkFormat fbDepthFormat;
- VkBool32 validDepthFormat = vks::tools::getSupportedDepthFormat(physicalDevice, &fbDepthFormat);
- assert(validDepthFormat);
-
- // Create a separate render pass for the offscreen rendering as it may differ from the one used for scene rendering
-
- std::array attchmentDescriptions = {};
- // Color attachment
- attchmentDescriptions[0].format = FB_COLOR_FORMAT;
- attchmentDescriptions[0].samples = VK_SAMPLE_COUNT_1_BIT;
- attchmentDescriptions[0].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
- attchmentDescriptions[0].storeOp = VK_ATTACHMENT_STORE_OP_STORE;
- attchmentDescriptions[0].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
- attchmentDescriptions[0].stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
- attchmentDescriptions[0].initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
- attchmentDescriptions[0].finalLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;
- // Depth attachment
- attchmentDescriptions[1].format = fbDepthFormat;
- attchmentDescriptions[1].samples = VK_SAMPLE_COUNT_1_BIT;
- attchmentDescriptions[1].loadOp = VK_ATTACHMENT_LOAD_OP_CLEAR;
- attchmentDescriptions[1].storeOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
- attchmentDescriptions[1].stencilLoadOp = VK_ATTACHMENT_LOAD_OP_DONT_CARE;
- attchmentDescriptions[1].stencilStoreOp = VK_ATTACHMENT_STORE_OP_DONT_CARE;
- attchmentDescriptions[1].initialLayout = VK_IMAGE_LAYOUT_UNDEFINED;
- attchmentDescriptions[1].finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
-
- VkAttachmentReference colorReference = { 0, VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL };
- VkAttachmentReference depthReference = { 1, VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL };
-
- VkSubpassDescription subpassDescription = {};
- subpassDescription.pipelineBindPoint = VK_PIPELINE_BIND_POINT_GRAPHICS;
- subpassDescription.colorAttachmentCount = 1;
- subpassDescription.pColorAttachments = &colorReference;
- subpassDescription.pDepthStencilAttachment = &depthReference;
-
- // Use subpass dependencies for layout transitions
- std::array dependencies;
-
- dependencies[0].srcSubpass = VK_SUBPASS_EXTERNAL;
- dependencies[0].dstSubpass = 0;
- dependencies[0].srcStageMask = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
- dependencies[0].dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
- dependencies[0].srcAccessMask = VK_ACCESS_SHADER_READ_BIT;
- dependencies[0].dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
- dependencies[0].dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT;
-
- dependencies[1].srcSubpass = 0;
- dependencies[1].dstSubpass = VK_SUBPASS_EXTERNAL;
- dependencies[1].srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT;
- dependencies[1].dstStageMask = VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
- dependencies[1].srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT;
- dependencies[1].dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
- dependencies[1].dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT;
-
- // Create the actual renderpass
- VkRenderPassCreateInfo renderPassInfo = {};
- renderPassInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
- renderPassInfo.attachmentCount = static_cast(attchmentDescriptions.size());
- renderPassInfo.pAttachments = attchmentDescriptions.data();
- renderPassInfo.subpassCount = 1;
- renderPassInfo.pSubpasses = &subpassDescription;
- renderPassInfo.dependencyCount = static_cast(dependencies.size());
- renderPassInfo.pDependencies = dependencies.data();
-
- VK_CHECK_RESULT(vkCreateRenderPass(device, &renderPassInfo, nullptr, &offscreenPass.renderPass));
-
- // Create sampler to sample from the color attachments
- VkSamplerCreateInfo sampler = vks::initializers::samplerCreateInfo();
- sampler.magFilter = VK_FILTER_LINEAR;
- sampler.minFilter = VK_FILTER_LINEAR;
- sampler.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR;
- sampler.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
- sampler.addressModeV = sampler.addressModeU;
- sampler.addressModeW = sampler.addressModeU;
- sampler.mipLodBias = 0.0f;
- sampler.maxAnisotropy = 1.0f;
- sampler.minLod = 0.0f;
- sampler.maxLod = 1.0f;
- sampler.borderColor = VK_BORDER_COLOR_FLOAT_OPAQUE_WHITE;
- VK_CHECK_RESULT(vkCreateSampler(device, &sampler, nullptr, &offscreenPass.sampler));
-
- // Create two frame buffers
- prepareOffscreenFramebuffer(&offscreenPass.framebuffers[0], FB_COLOR_FORMAT, fbDepthFormat);
- prepareOffscreenFramebuffer(&offscreenPass.framebuffers[1], FB_COLOR_FORMAT, fbDepthFormat);
- }
-
- void buildCommandBuffers()
- {
- VkCommandBufferBeginInfo cmdBufInfo = vks::initializers::commandBufferBeginInfo();
-
- VkClearValue clearValues[2];
- VkViewport viewport;
- VkRect2D scissor;
-
- /*
- The blur method used in this example is multi pass and renders the vertical blur first and then the horizontal one
- While it's possible to blur in one pass, this method is widely used as it requires far less samples to generate the blur
- */
-
- for (int32_t i = 0; i < drawCmdBuffers.size(); ++i)
- {
- VK_CHECK_RESULT(vkBeginCommandBuffer(drawCmdBuffers[i], &cmdBufInfo));
-
- if (bloom) {
- clearValues[0].color = { { 0.0f, 0.0f, 0.0f, 1.0f } };
- clearValues[1].depthStencil = { 1.0f, 0 };
-
- VkRenderPassBeginInfo renderPassBeginInfo = vks::initializers::renderPassBeginInfo();
- renderPassBeginInfo.renderPass = offscreenPass.renderPass;
- renderPassBeginInfo.framebuffer = offscreenPass.framebuffers[0].framebuffer;
- renderPassBeginInfo.renderArea.extent.width = offscreenPass.width;
- renderPassBeginInfo.renderArea.extent.height = offscreenPass.height;
- renderPassBeginInfo.clearValueCount = 2;
- renderPassBeginInfo.pClearValues = clearValues;
-
- viewport = vks::initializers::viewport((float)offscreenPass.width, (float)offscreenPass.height, 0.0f, 1.0f);
- vkCmdSetViewport(drawCmdBuffers[i], 0, 1, &viewport);
-
- scissor = vks::initializers::rect2D(offscreenPass.width, offscreenPass.height, 0, 0);
- vkCmdSetScissor(drawCmdBuffers[i], 0, 1, &scissor);
-
- /*
- First render pass: Render glow parts of the model (separate mesh) to an offscreen frame buffer
- */
-
- vkCmdBeginRenderPass(drawCmdBuffers[i], &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
-
- vkCmdBindDescriptorSets(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayouts.scene, 0, 1, &descriptorSets.scene, 0, NULL);
- vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelines.glowPass);
-
- models.ufoGlow.draw(drawCmdBuffers[i]);
-
- vkCmdEndRenderPass(drawCmdBuffers[i]);
-
- /*
- Second render pass: Vertical blur
-
- Render contents of the first pass into a second framebuffer and apply a vertical blur
- This is the first blur pass, the horizontal blur is applied when rendering on top of the scene
- */
-
- renderPassBeginInfo.framebuffer = offscreenPass.framebuffers[1].framebuffer;
-
- vkCmdBeginRenderPass(drawCmdBuffers[i], &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
-
- vkCmdBindDescriptorSets(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayouts.blur, 0, 1, &descriptorSets.blurVert, 0, NULL);
- vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelines.blurVert);
- vkCmdDraw(drawCmdBuffers[i], 3, 1, 0, 0);
-
- vkCmdEndRenderPass(drawCmdBuffers[i]);
- }
-
- /*
- Note: Explicit synchronization is not required between the render pass, as this is done implicit via sub pass dependencies
- */
-
- /*
- Third render pass: Scene rendering with applied vertical blur
-
- Renders the scene and the (vertically blurred) contents of the second framebuffer and apply a horizontal blur
-
- */
- {
- clearValues[0].color = defaultClearColor;
- clearValues[1].depthStencil = { 1.0f, 0 };
-
- VkRenderPassBeginInfo renderPassBeginInfo = vks::initializers::renderPassBeginInfo();
- renderPassBeginInfo.renderPass = renderPass;
- renderPassBeginInfo.framebuffer = frameBuffers[i];
- renderPassBeginInfo.renderArea.extent.width = width;
- renderPassBeginInfo.renderArea.extent.height = height;
- renderPassBeginInfo.clearValueCount = 2;
- renderPassBeginInfo.pClearValues = clearValues;
-
- vkCmdBeginRenderPass(drawCmdBuffers[i], &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
-
- VkViewport viewport = vks::initializers::viewport((float)width, (float)height, 0.0f, 1.0f);
- vkCmdSetViewport(drawCmdBuffers[i], 0, 1, &viewport);
-
- VkRect2D scissor = vks::initializers::rect2D(width, height, 0, 0);
- vkCmdSetScissor(drawCmdBuffers[i], 0, 1, &scissor);
-
- // Skybox
- vkCmdBindDescriptorSets(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayouts.scene, 0, 1, &descriptorSets.skyBox, 0, NULL);
- vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelines.skyBox);
- models.skyBox.draw(drawCmdBuffers[i]);
-
- // 3D scene
- vkCmdBindDescriptorSets(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayouts.scene, 0, 1, &descriptorSets.scene, 0, NULL);
- vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelines.phongPass);
- models.ufo.draw(drawCmdBuffers[i]);
-
- if (bloom)
- {
- vkCmdBindDescriptorSets(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayouts.blur, 0, 1, &descriptorSets.blurHorz, 0, NULL);
- vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelines.blurHorz);
- vkCmdDraw(drawCmdBuffers[i], 3, 1, 0, 0);
- }
-
- drawUI(drawCmdBuffers[i]);
-
- vkCmdEndRenderPass(drawCmdBuffers[i]);
-
- }
-
- VK_CHECK_RESULT(vkEndCommandBuffer(drawCmdBuffers[i]));
- }
- }
-
- void loadAssets()
- {
- const uint32_t glTFLoadingFlags = vkglTF::FileLoadingFlags::PreTransformVertices | vkglTF::FileLoadingFlags::PreMultiplyVertexColors | vkglTF::FileLoadingFlags::FlipY;
- models.ufo.loadFromFile(getAssetPath() + "models/retroufo.gltf", vulkanDevice, queue, glTFLoadingFlags);
- models.ufoGlow.loadFromFile(getAssetPath() + "models/retroufo_glow.gltf", vulkanDevice, queue, glTFLoadingFlags);
- models.skyBox.loadFromFile(getAssetPath() + "models/cube.gltf", vulkanDevice, queue, glTFLoadingFlags);
- cubemap.loadFromFile(getAssetPath() + "textures/cubemap_space.ktx", VK_FORMAT_R8G8B8A8_UNORM, vulkanDevice, queue);
- }
-
- void setupDescriptors()
- {
- // Pool
- std::vector poolSizes = {
- vks::initializers::descriptorPoolSize(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 8),
- vks::initializers::descriptorPoolSize(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 6)
- };
- VkDescriptorPoolCreateInfo descriptorPoolInfo = vks::initializers::descriptorPoolCreateInfo(poolSizes, 5);
- VK_CHECK_RESULT(vkCreateDescriptorPool(device, &descriptorPoolInfo, nullptr, &descriptorPool));
-
- // Layouts
- std::vector setLayoutBindings;
- VkDescriptorSetLayoutCreateInfo descriptorSetLayoutCreateInfo;
-
- // Fullscreen blur
- setLayoutBindings = {
- vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_SHADER_STAGE_FRAGMENT_BIT, 0), // Binding 0: Fragment shader uniform buffer
- vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_SHADER_STAGE_FRAGMENT_BIT, 1) // Binding 1: Fragment shader image sampler
- };
- descriptorSetLayoutCreateInfo = vks::initializers::descriptorSetLayoutCreateInfo(setLayoutBindings.data(), static_cast(setLayoutBindings.size()));
- VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device, &descriptorSetLayoutCreateInfo, nullptr, &descriptorSetLayouts.blur));
-
- // Scene rendering
- setLayoutBindings = {
- vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_SHADER_STAGE_VERTEX_BIT, 0), // Binding 0 : Vertex shader uniform buffer
- vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_SHADER_STAGE_FRAGMENT_BIT, 1), // Binding 1 : Fragment shader image sampler
- vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_SHADER_STAGE_FRAGMENT_BIT, 2), // Binding 2 : Fragment shader image sampler
- };
-
- descriptorSetLayoutCreateInfo = vks::initializers::descriptorSetLayoutCreateInfo(setLayoutBindings);
- VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device, &descriptorSetLayoutCreateInfo, nullptr, &descriptorSetLayouts.scene));
-
- // Sets
- VkDescriptorSetAllocateInfo descriptorSetAllocInfo;
- std::vector writeDescriptorSets;
-
- // Full screen blur
- // Vertical
- descriptorSetAllocInfo = vks::initializers::descriptorSetAllocateInfo(descriptorPool, &descriptorSetLayouts.blur, 1);
- VK_CHECK_RESULT(vkAllocateDescriptorSets(device, &descriptorSetAllocInfo, &descriptorSets.blurVert));
- writeDescriptorSets = {
- vks::initializers::writeDescriptorSet(descriptorSets.blurVert, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 0, &uniformBuffers.blurParams.descriptor), // Binding 0: Fragment shader uniform buffer
- vks::initializers::writeDescriptorSet(descriptorSets.blurVert, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, &offscreenPass.framebuffers[0].descriptor), // Binding 1: Fragment shader texture sampler
- };
- vkUpdateDescriptorSets(device, static_cast(writeDescriptorSets.size()), writeDescriptorSets.data(), 0, nullptr);
- // Horizontal
- descriptorSetAllocInfo = vks::initializers::descriptorSetAllocateInfo(descriptorPool, &descriptorSetLayouts.blur, 1);
- VK_CHECK_RESULT(vkAllocateDescriptorSets(device, &descriptorSetAllocInfo, &descriptorSets.blurHorz));
- writeDescriptorSets = {
- vks::initializers::writeDescriptorSet(descriptorSets.blurHorz, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 0, &uniformBuffers.blurParams.descriptor), // Binding 0: Fragment shader uniform buffer
- vks::initializers::writeDescriptorSet(descriptorSets.blurHorz, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, &offscreenPass.framebuffers[1].descriptor), // Binding 1: Fragment shader texture sampler
- };
- vkUpdateDescriptorSets(device, static_cast(writeDescriptorSets.size()), writeDescriptorSets.data(), 0, nullptr);
-
- // Scene rendering
- descriptorSetAllocInfo = vks::initializers::descriptorSetAllocateInfo(descriptorPool, &descriptorSetLayouts.scene, 1);
- VK_CHECK_RESULT(vkAllocateDescriptorSets(device, &descriptorSetAllocInfo, &descriptorSets.scene));
- writeDescriptorSets = {
- vks::initializers::writeDescriptorSet(descriptorSets.scene, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 0, &uniformBuffers.scene.descriptor) // Binding 0: Vertex shader uniform buffer
- };
- vkUpdateDescriptorSets(device, static_cast(writeDescriptorSets.size()), writeDescriptorSets.data(), 0, nullptr);
-
- // Skybox
- VK_CHECK_RESULT(vkAllocateDescriptorSets(device, &descriptorSetAllocInfo, &descriptorSets.skyBox));
- writeDescriptorSets = {
- vks::initializers::writeDescriptorSet(descriptorSets.skyBox, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 0, &uniformBuffers.skyBox.descriptor), // Binding 0: Vertex shader uniform buffer
- vks::initializers::writeDescriptorSet(descriptorSets.skyBox, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, &cubemap.descriptor), // Binding 1: Fragment shader texture sampler
- };
- vkUpdateDescriptorSets(device, static_cast(writeDescriptorSets.size()), writeDescriptorSets.data(), 0, nullptr);
- }
-
- void preparePipelines()
- {
- // Layouts
- VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vks::initializers::pipelineLayoutCreateInfo(&descriptorSetLayouts.blur, 1);
- VK_CHECK_RESULT(vkCreatePipelineLayout(device, &pipelineLayoutCreateInfo, nullptr, &pipelineLayouts.blur));
-
- pipelineLayoutCreateInfo = vks::initializers::pipelineLayoutCreateInfo(&descriptorSetLayouts.scene, 1);
- VK_CHECK_RESULT(vkCreatePipelineLayout(device, &pipelineLayoutCreateInfo, nullptr, &pipelineLayouts.scene));
-
- // Pipelines
- VkPipelineInputAssemblyStateCreateInfo inputAssemblyStateCI = vks::initializers::pipelineInputAssemblyStateCreateInfo(VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, 0, VK_FALSE);
- VkPipelineRasterizationStateCreateInfo rasterizationStateCI = vks::initializers::pipelineRasterizationStateCreateInfo(VK_POLYGON_MODE_FILL, VK_CULL_MODE_NONE, VK_FRONT_FACE_COUNTER_CLOCKWISE, 0);
- VkPipelineColorBlendAttachmentState blendAttachmentState = vks::initializers::pipelineColorBlendAttachmentState(0xf, VK_FALSE);
- VkPipelineColorBlendStateCreateInfo colorBlendStateCI = vks::initializers::pipelineColorBlendStateCreateInfo(1, &blendAttachmentState);
- VkPipelineDepthStencilStateCreateInfo depthStencilStateCI = vks::initializers::pipelineDepthStencilStateCreateInfo(VK_TRUE, VK_TRUE, VK_COMPARE_OP_LESS_OR_EQUAL);
- VkPipelineViewportStateCreateInfo viewportStateCI = vks::initializers::pipelineViewportStateCreateInfo(1, 1, 0);
- VkPipelineMultisampleStateCreateInfo multisampleStateCI = vks::initializers::pipelineMultisampleStateCreateInfo(VK_SAMPLE_COUNT_1_BIT, 0);
- std::vector dynamicStateEnables = { VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR };
- VkPipelineDynamicStateCreateInfo dynamicStateCI = vks::initializers::pipelineDynamicStateCreateInfo(dynamicStateEnables);
- std::array shaderStages;
-
- VkGraphicsPipelineCreateInfo pipelineCI = vks::initializers::pipelineCreateInfo(pipelineLayouts.blur, renderPass, 0);
- pipelineCI.pInputAssemblyState = &inputAssemblyStateCI;
- pipelineCI.pRasterizationState = &rasterizationStateCI;
- pipelineCI.pColorBlendState = &colorBlendStateCI;
- pipelineCI.pMultisampleState = &multisampleStateCI;
- pipelineCI.pViewportState = &viewportStateCI;
- pipelineCI.pDepthStencilState = &depthStencilStateCI;
- pipelineCI.pDynamicState = &dynamicStateCI;
- pipelineCI.stageCount = static_cast(shaderStages.size());
- pipelineCI.pStages = shaderStages.data();
-
- // Blur pipelines
- shaderStages[0] = loadShader(getShadersPath() + "bloom/gaussblur.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
- shaderStages[1] = loadShader(getShadersPath() + "bloom/gaussblur.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
- // Empty vertex input state
- VkPipelineVertexInputStateCreateInfo emptyInputState = vks::initializers::pipelineVertexInputStateCreateInfo();
- pipelineCI.pVertexInputState = &emptyInputState;
- pipelineCI.layout = pipelineLayouts.blur;
- // Additive blending
- blendAttachmentState.colorWriteMask = 0xF;
- blendAttachmentState.blendEnable = VK_TRUE;
- blendAttachmentState.colorBlendOp = VK_BLEND_OP_ADD;
- blendAttachmentState.srcColorBlendFactor = VK_BLEND_FACTOR_ONE;
- blendAttachmentState.dstColorBlendFactor = VK_BLEND_FACTOR_ONE;
- blendAttachmentState.alphaBlendOp = VK_BLEND_OP_ADD;
- blendAttachmentState.srcAlphaBlendFactor = VK_BLEND_FACTOR_SRC_ALPHA;
- blendAttachmentState.dstAlphaBlendFactor = VK_BLEND_FACTOR_DST_ALPHA;
-
- // Use specialization constants to select between horizontal and vertical blur
- uint32_t blurdirection = 0;
- VkSpecializationMapEntry specializationMapEntry = vks::initializers::specializationMapEntry(0, 0, sizeof(uint32_t));
- VkSpecializationInfo specializationInfo = vks::initializers::specializationInfo(1, &specializationMapEntry, sizeof(uint32_t), &blurdirection);
- shaderStages[1].pSpecializationInfo = &specializationInfo;
- // Vertical blur pipeline
- pipelineCI.renderPass = offscreenPass.renderPass;
- VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCI, nullptr, &pipelines.blurVert));
- // Horizontal blur pipeline
- blurdirection = 1;
- pipelineCI.renderPass = renderPass;
- VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCI, nullptr, &pipelines.blurHorz));
-
- // Phong pass (3D model)
- pipelineCI.pVertexInputState = vkglTF::Vertex::getPipelineVertexInputState({vkglTF::VertexComponent::Position, vkglTF::VertexComponent::UV, vkglTF::VertexComponent::Color, vkglTF::VertexComponent::Normal});
- pipelineCI.layout = pipelineLayouts.scene;
- shaderStages[0] = loadShader(getShadersPath() + "bloom/phongpass.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
- shaderStages[1] = loadShader(getShadersPath() + "bloom/phongpass.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
- blendAttachmentState.blendEnable = VK_FALSE;
- depthStencilStateCI.depthWriteEnable = VK_TRUE;
- rasterizationStateCI.cullMode = VK_CULL_MODE_BACK_BIT;
- pipelineCI.renderPass = renderPass;
- VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCI, nullptr, &pipelines.phongPass));
-
- // Color only pass (offscreen blur base)
- shaderStages[0] = loadShader(getShadersPath() + "bloom/colorpass.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
- shaderStages[1] = loadShader(getShadersPath() + "bloom/colorpass.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
- pipelineCI.renderPass = offscreenPass.renderPass;
- VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCI, nullptr, &pipelines.glowPass));
-
- // Skybox (cubemap)
- shaderStages[0] = loadShader(getShadersPath() + "bloom/skybox.vert.spv", VK_SHADER_STAGE_VERTEX_BIT);
- shaderStages[1] = loadShader(getShadersPath() + "bloom/skybox.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT);
- depthStencilStateCI.depthWriteEnable = VK_FALSE;
- rasterizationStateCI.cullMode = VK_CULL_MODE_FRONT_BIT;
- pipelineCI.renderPass = renderPass;
- VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCI, nullptr, &pipelines.skyBox));
- }
-
- // Prepare and initialize uniform buffer containing shader uniforms
- void prepareUniformBuffers()
- {
- // Phong and color pass vertex shader uniform buffer
- VK_CHECK_RESULT(vulkanDevice->createBuffer(
- VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT,
- VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
- &uniformBuffers.scene,
- sizeof(ubos.scene)));
-
- // Blur parameters uniform buffers
- VK_CHECK_RESULT(vulkanDevice->createBuffer(
- VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT,
- VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
- &uniformBuffers.blurParams,
- sizeof(ubos.blurParams)));
-
- // Skybox
- VK_CHECK_RESULT(vulkanDevice->createBuffer(
- VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT,
- VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
- &uniformBuffers.skyBox,
- sizeof(ubos.skyBox)));
-
- // Map persistent
- VK_CHECK_RESULT(uniformBuffers.scene.map());
- VK_CHECK_RESULT(uniformBuffers.blurParams.map());
- VK_CHECK_RESULT(uniformBuffers.skyBox.map());
-
- // Initialize uniform buffers
- updateUniformBuffersScene();
- updateUniformBuffersBlur();
- }
-
- // Update uniform buffers for rendering the 3D scene
- void updateUniformBuffersScene()
- {
- // UFO
- ubos.scene.projection = camera.matrices.perspective;
- ubos.scene.view = camera.matrices.view;
-
- ubos.scene.model = glm::translate(glm::mat4(1.0f), glm::vec3(sin(glm::radians(timer * 360.0f)) * 0.25f, -1.0f, cos(glm::radians(timer * 360.0f)) * 0.25f));
- ubos.scene.model = glm::rotate(ubos.scene.model, -sinf(glm::radians(timer * 360.0f)) * 0.15f, glm::vec3(1.0f, 0.0f, 0.0f));
- ubos.scene.model = glm::rotate(ubos.scene.model, glm::radians(timer * 360.0f), glm::vec3(0.0f, 1.0f, 0.0f));
-
- memcpy(uniformBuffers.scene.mapped, &ubos.scene, sizeof(ubos.scene));
-
- // Skybox
- ubos.skyBox.projection = glm::perspective(glm::radians(45.0f), (float)width / (float)height, 0.1f, 256.0f);
- ubos.skyBox.view = glm::mat4(glm::mat3(camera.matrices.view));
- ubos.skyBox.model = glm::mat4(1.0f);
-
- memcpy(uniformBuffers.skyBox.mapped, &ubos.skyBox, sizeof(ubos.skyBox));
- }
-
- // Update blur pass parameter uniform buffer
- void updateUniformBuffersBlur()
- {
- memcpy(uniformBuffers.blurParams.mapped, &ubos.blurParams, sizeof(ubos.blurParams));
- }
-
- void draw()
- {
- VulkanExampleBase::prepareFrame();
- submitInfo.commandBufferCount = 1;
- submitInfo.pCommandBuffers = &drawCmdBuffers[currentBuffer];
- VK_CHECK_RESULT(vkQueueSubmit(queue, 1, &submitInfo, VK_NULL_HANDLE));
- VulkanExampleBase::submitFrame();
- }
-
- void prepare()
- {
- VulkanExampleBase::prepare();
- loadAssets();
- prepareUniformBuffers();
- prepareOffscreen();
- setupDescriptors();
- preparePipelines();
- buildCommandBuffers();
- prepared = true;
- }
-
- virtual void render()
- {
- if (!prepared)
- return;
- draw();
- if (!paused || camera.updated)
- {
- updateUniformBuffersScene();
- }
- }
-
- virtual void OnUpdateUIOverlay(vks::UIOverlay *overlay)
- {
- if (overlay->header("Settings")) {
- if (overlay->checkBox("Bloom", &bloom)) {
- buildCommandBuffers();
- }
- if (overlay->inputFloat("Scale", &ubos.blurParams.blurScale, 0.1f, 2)) {
- updateUniformBuffersBlur();
- }
- }
- }
-};
-
-VULKAN_EXAMPLE_MAIN()
diff --git a/examples/bufferdeviceaddress/bufferdeviceaddress.cpp b/examples/bufferdeviceaddress/bufferdeviceaddress.cpp
deleted file mode 100644
index 160bdc86..00000000
--- a/examples/bufferdeviceaddress/bufferdeviceaddress.cpp
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
-* Vulkan Example - Buffer device address
-*
-* This sample shows how to read data from a buffer device address (aka "reference") instead of using uniforms
-* The application passes buffer device addresses to the shader via push constants, and the shader then simply reads the data behind that address
-* See cube.vert for the shader side of things
-*
-* Copyright (C) 2024 by Sascha Willems - www.saschawillems.de
-*
-*/
-
-#include "vulkanexamplebase.h"
-#include "VulkanglTFModel.h"
-
-class VulkanExample : public VulkanExampleBase
-{
-public:
- bool animate = true;
-
- struct Cube {
- glm::mat4 modelMatrix;
- vks::Buffer buffer;
- glm::vec3 rotation;
- VkDeviceAddress bufferDeviceAddress{};
- };
- std::array cubes{};
-
- vks::Texture2D texture;
- vkglTF::Model model;
-
- // Global matrices
- struct Scene {
- glm::mat4 mvp;
- vks::Buffer buffer;
- VkDeviceAddress bufferDeviceAddress{};
- } scene;
-
- VkPipeline pipeline{ VK_NULL_HANDLE };
- VkPipelineLayout pipelineLayout{ VK_NULL_HANDLE };
- VkDescriptorSet descriptorSet{ VK_NULL_HANDLE };
- VkDescriptorSetLayout descriptorSetLayout{ VK_NULL_HANDLE };
-
- PFN_vkGetBufferDeviceAddressKHR vkGetBufferDeviceAddressKHR{ VK_NULL_HANDLE };
- VkPhysicalDeviceBufferDeviceAddressFeatures enabledBufferDeviceAddresFeatures{};
-
- // This sample passes the buffer references ("pointer") using push constants, the shader then reads data from that buffer address
- struct PushConstantBlock {
- // Reference to the global matrices
- VkDeviceAddress sceneReference;
- // Reference to the per model matrices
- VkDeviceAddress modelReference;
- };
-
- VulkanExample() : VulkanExampleBase()
- {
- title = "Buffer device address";
- camera.type = Camera::CameraType::lookat;
- camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
- camera.setRotation(glm::vec3(0.0f, 0.0f, 0.0f));
- camera.setTranslation(glm::vec3(0.0f, 0.0f, -5.0f));
-
- enabledInstanceExtensions.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
- enabledInstanceExtensions.push_back(VK_KHR_DEVICE_GROUP_CREATION_EXTENSION_NAME);
- enabledDeviceExtensions.push_back(VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME);
- enabledDeviceExtensions.push_back(VK_KHR_DEVICE_GROUP_EXTENSION_NAME);
-
- enabledBufferDeviceAddresFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES;
- enabledBufferDeviceAddresFeatures.bufferDeviceAddress = VK_TRUE;
-
- deviceCreatepNextChain = &enabledBufferDeviceAddresFeatures;
- }
-
- ~VulkanExample()
- {
- if (device) {
- vkDestroyPipeline(device, pipeline, nullptr);
- vkDestroyPipelineLayout(device, pipelineLayout, nullptr);
- vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr);
- texture.destroy();
- for (auto cube : cubes) {
- cube.buffer.destroy();
- }
- scene.buffer.destroy();
- }
- }
-
- virtual void getEnabledFeatures()
- {
- if (deviceFeatures.samplerAnisotropy) {
- enabledFeatures.samplerAnisotropy = VK_TRUE;
- };
- }
-
- void loadAssets()
- {
- const uint32_t glTFLoadingFlags = vkglTF::FileLoadingFlags::PreTransformVertices | vkglTF::FileLoadingFlags::PreMultiplyVertexColors | vkglTF::FileLoadingFlags::FlipY;
- model.loadFromFile(getAssetPath() + "models/cube.gltf", vulkanDevice, queue, glTFLoadingFlags);
- texture.loadFromFile(getAssetPath() + "textures/crate01_color_height_rgba.ktx", VK_FORMAT_R8G8B8A8_UNORM, vulkanDevice, queue);
- }
-
- // We pass all data via buffer device addresses, so we only allocate descriptors for the images
- void setupDescriptors()
- {
- // Pool
- std::vector descriptorPoolSizes = {
- vks::initializers::descriptorPoolSize(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1)
- };
- VkDescriptorPoolCreateInfo descriptorPoolInfo = vks::initializers::descriptorPoolCreateInfo(descriptorPoolSizes, 2);
- VK_CHECK_RESULT(vkCreateDescriptorPool(device, &descriptorPoolInfo, nullptr, &descriptorPool));
-
- // Layout
- std::vector setLayoutBindings = {
- vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_SHADER_STAGE_FRAGMENT_BIT, 0)
- };
- VkDescriptorSetLayoutCreateInfo descriptorLayout = vks::initializers::descriptorSetLayoutCreateInfo(setLayoutBindings);
- VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device, &descriptorLayout, nullptr, &descriptorSetLayout));
-
- // Set
- VkDescriptorSetAllocateInfo allocInfo = vks::initializers::descriptorSetAllocateInfo(descriptorPool, &descriptorSetLayout, 1);
- VK_CHECK_RESULT(vkAllocateDescriptorSets(device, &allocInfo, &descriptorSet));
-
- std::vector writeDescriptorSets = {
- vks::initializers::writeDescriptorSet(descriptorSet, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 0, &texture.descriptor)
- };
- vkUpdateDescriptorSets(device, static_cast(writeDescriptorSets.size()), writeDescriptorSets.data(), 0, nullptr);
- }
-
- void preparePipelines()
- {
- // The buffer addresses will be passed to the shader using push constants
- // That way it's very easy to do a draw call, change the reference to another buffer (or part of that buffer) and do the next draw call using different data
- VkPushConstantRange pushConstantRange{};
- pushConstantRange.stageFlags = VK_SHADER_STAGE_VERTEX_BIT;
- pushConstantRange.offset = 0;
- pushConstantRange.size = sizeof(PushConstantBlock);
-
- VkPipelineLayoutCreateInfo pipelineLayoutCI = vks::initializers::pipelineLayoutCreateInfo();
- pipelineLayoutCI.pushConstantRangeCount = 1;
- pipelineLayoutCI.pPushConstantRanges = &pushConstantRange;
- pipelineLayoutCI.setLayoutCount = 1;
- pipelineLayoutCI.pSetLayouts = &descriptorSetLayout;
- VK_CHECK_RESULT(vkCreatePipelineLayout(device, &pipelineLayoutCI, nullptr, &pipelineLayout));
-
- const std::vector dynamicStateEnables = { VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR };
-
- VkPipelineInputAssemblyStateCreateInfo inputAssemblyStateCI = vks::initializers::pipelineInputAssemblyStateCreateInfo(VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, 0, VK_FALSE);
- VkPipelineRasterizationStateCreateInfo rasterizationStateCI = vks::initializers::pipelineRasterizationStateCreateInfo(VK_POLYGON_MODE_FILL, VK_CULL_MODE_BACK_BIT, VK_FRONT_FACE_COUNTER_CLOCKWISE, 0);
- VkPipelineColorBlendAttachmentState blendAttachmentState = vks::initializers::pipelineColorBlendAttachmentState(0xf, VK_FALSE);
- VkPipelineColorBlendStateCreateInfo colorBlendStateCI = vks::initializers::pipelineColorBlendStateCreateInfo(1, &blendAttachmentState);
- VkPipelineDepthStencilStateCreateInfo depthStencilStateCI = vks::initializers::pipelineDepthStencilStateCreateInfo(VK_TRUE, VK_TRUE, VK_COMPARE_OP_LESS_OR_EQUAL);
- VkPipelineViewportStateCreateInfo viewportStateCI = vks::initializers::pipelineViewportStateCreateInfo(1, 1, 0);
- VkPipelineMultisampleStateCreateInfo multisampleStateCI = vks::initializers::pipelineMultisampleStateCreateInfo(VK_SAMPLE_COUNT_1_BIT, 0);
- VkPipelineDynamicStateCreateInfo dynamicStateCI = vks::initializers::pipelineDynamicStateCreateInfo(dynamicStateEnables.data(), static_cast(dynamicStateEnables.size()), 0);
- std::array shaderStages = {
- loadShader(getShadersPath() + "bufferdeviceaddress/cube.vert.spv", VK_SHADER_STAGE_VERTEX_BIT),
- loadShader(getShadersPath() + "bufferdeviceaddress/cube.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT)
- };
-
- VkGraphicsPipelineCreateInfo pipelineCI = vks::initializers::pipelineCreateInfo(pipelineLayout, renderPass, 0);
- pipelineCI.pInputAssemblyState = &inputAssemblyStateCI;
- pipelineCI.pRasterizationState = &rasterizationStateCI;
- pipelineCI.pColorBlendState = &colorBlendStateCI;
- pipelineCI.pMultisampleState = &multisampleStateCI;
- pipelineCI.pViewportState = &viewportStateCI;
- pipelineCI.pDepthStencilState = &depthStencilStateCI;
- pipelineCI.pDynamicState = &dynamicStateCI;
- pipelineCI.stageCount = static_cast(shaderStages.size());
- pipelineCI.pStages = shaderStages.data();
- pipelineCI.pVertexInputState = vkglTF::Vertex::getPipelineVertexInputState({ vkglTF::VertexComponent::Position, vkglTF::VertexComponent::Normal, vkglTF::VertexComponent::UV, vkglTF::VertexComponent::Color });
- VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCI, nullptr, &pipeline));
- }
-
- void prepareBuffers()
- {
- // Note that we don't use this buffer for uniforms but rather pass it's address as a reference to the shader, so isntead of the uniform buffer usage we use a different flag
- VK_CHECK_RESULT(vulkanDevice->createBuffer(VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, &scene.buffer, sizeof(glm::mat4)));
- VK_CHECK_RESULT(scene.buffer.map());
-
- // Get the device of this buffer that is later on passed to the shader (aka "reference")
- VkBufferDeviceAddressInfo bufferDeviceAdressInfo{};
- bufferDeviceAdressInfo.sType = VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO;
- bufferDeviceAdressInfo.buffer = scene.buffer.buffer;
- scene.bufferDeviceAddress = vkGetBufferDeviceAddressKHR(device, &bufferDeviceAdressInfo);
-
- for (auto& cube : cubes) {
- // Note that we don't use this buffer for uniforms but rather pass it's address as a reference to the shader, so isntead of the uniform buffer usage we use a different flag
- VK_CHECK_RESULT(vulkanDevice->createBuffer(VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, &cube.buffer, sizeof(glm::mat4)));
- VK_CHECK_RESULT(cube.buffer.map());
-
- // Get the device of this buffer that is later on passed to the shader (aka "reference")
- bufferDeviceAdressInfo.buffer = cube.buffer.buffer;
- cube.bufferDeviceAddress = vkGetBufferDeviceAddressKHR(device, &bufferDeviceAdressInfo);
- }
- updateBuffers();
- }
-
- void updateBuffers()
- {
- scene.mvp = camera.matrices.perspective * camera.matrices.view;
- memcpy(scene.buffer.mapped, &scene, sizeof(glm::mat4));
-
- cubes[0].modelMatrix = glm::translate(glm::mat4(1.0f), glm::vec3(-2.0f, 0.0f, 0.0f));
- cubes[1].modelMatrix = glm::translate(glm::mat4(1.0f), glm::vec3(1.5f, 0.5f, 0.0f));
-
- for (auto& cube : cubes) {
- cube.modelMatrix = glm::rotate(cube.modelMatrix, glm::radians(cube.rotation.x), glm::vec3(1.0f, 0.0f, 0.0f));
- cube.modelMatrix = glm::rotate(cube.modelMatrix, glm::radians(cube.rotation.y), glm::vec3(0.0f, 1.0f, 0.0f));
- cube.modelMatrix = glm::rotate(cube.modelMatrix, glm::radians(cube.rotation.z), glm::vec3(0.0f, 0.0f, 1.0f));
- cube.modelMatrix = glm::scale(cube.modelMatrix, glm::vec3(0.25f));
- memcpy(cube.buffer.mapped, &cube.modelMatrix, sizeof(glm::mat4));
- }
- }
-
- void prepare()
- {
- VulkanExampleBase::prepare();
-
- // We need this extension function to get the address of a buffer so we can pass it to the shader
- vkGetBufferDeviceAddressKHR = reinterpret_cast(vkGetDeviceProcAddr(device, "vkGetBufferDeviceAddressKHR"));
-
- loadAssets();
- prepareBuffers();
- setupDescriptors();
- preparePipelines();
- buildCommandBuffers();
- prepared = true;
- }
-
- void buildCommandBuffers()
- {
- VkCommandBufferBeginInfo cmdBufInfo = vks::initializers::commandBufferBeginInfo();
-
- VkClearValue clearValues[2];
- clearValues[0].color = defaultClearColor;
- clearValues[1].depthStencil = { 1.0f, 0 };
-
- VkRenderPassBeginInfo renderPassBeginInfo = vks::initializers::renderPassBeginInfo();
- renderPassBeginInfo.renderPass = renderPass;
- renderPassBeginInfo.renderArea.offset.x = 0;
- renderPassBeginInfo.renderArea.offset.y = 0;
- renderPassBeginInfo.renderArea.extent.width = width;
- renderPassBeginInfo.renderArea.extent.height = height;
- renderPassBeginInfo.clearValueCount = 2;
- renderPassBeginInfo.pClearValues = clearValues;
-
- for (int32_t i = 0; i < drawCmdBuffers.size(); ++i) {
- renderPassBeginInfo.framebuffer = frameBuffers[i];
-
- VK_CHECK_RESULT(vkBeginCommandBuffer(drawCmdBuffers[i], &cmdBufInfo));
-
- vkCmdBeginRenderPass(drawCmdBuffers[i], &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
-
- vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
-
- VkViewport viewport = vks::initializers::viewport((float)width, (float)height, 0.0f, 1.0f);
- vkCmdSetViewport(drawCmdBuffers[i], 0, 1, &viewport);
-
- VkRect2D scissor = vks::initializers::rect2D(width, height, 0, 0);
- vkCmdSetScissor(drawCmdBuffers[i], 0, 1, &scissor);
-
- vkCmdBindDescriptorSets(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &descriptorSet, 0, nullptr);
-
- model.bindBuffers(drawCmdBuffers[i]);
-
- // Instead of using descriptors to pass global and per-model matrices to the shader, we can now simply pass buffer references via push constants
- // The shader then simply reads data from the address of that reference
- PushConstantBlock references{};
- // Pass pointer to the global matrix via a buffer device address
- references.sceneReference = scene.bufferDeviceAddress;
-
- for (auto& cube : cubes) {
- // Pass pointer to this cube's data buffer via a buffer device address
- // So instead of having to bind different descriptors, we only pass a different device address
- // This doesn't have to be an address from a different buffer, but could very well be just another address in the same buffer
- references.modelReference = cube.bufferDeviceAddress;
- vkCmdPushConstants(drawCmdBuffers[i], pipelineLayout, VK_SHADER_STAGE_VERTEX_BIT, 0, sizeof(PushConstantBlock), &references);
-
- model.draw(drawCmdBuffers[i]);
- }
-
- drawUI(drawCmdBuffers[i]);
-
- vkCmdEndRenderPass(drawCmdBuffers[i]);
-
- VK_CHECK_RESULT(vkEndCommandBuffer(drawCmdBuffers[i]));
- }
- }
-
- void draw()
- {
- VulkanExampleBase::prepareFrame();
- submitInfo.commandBufferCount = 1;
- submitInfo.pCommandBuffers = &drawCmdBuffers[currentBuffer];
- VK_CHECK_RESULT(vkQueueSubmit(queue, 1, &submitInfo, VK_NULL_HANDLE));
- VulkanExampleBase::submitFrame();
- }
-
- virtual void render()
- {
- if (!prepared)
- return;
- draw();
- if (animate && !paused) {
- cubes[0].rotation.x += 2.5f * frameTimer;
- if (cubes[0].rotation.x > 360.0f)
- cubes[0].rotation.x -= 360.0f;
- cubes[1].rotation.y += 2.0f * frameTimer;
- if (cubes[1].rotation.x > 360.0f)
- cubes[1].rotation.x -= 360.0f;
- }
- if ((camera.updated) || (animate && !paused)) {
- updateBuffers();
- }
- }
-
- virtual void OnUpdateUIOverlay(vks::UIOverlay* overlay)
- {
- if (overlay->header("Settings")) {
- overlay->checkBox("Animate", &animate);
- }
- }
-};
-
-VULKAN_EXAMPLE_MAIN()
diff --git a/examples/computecloth/computecloth.cpp b/examples/computecloth/computecloth.cpp
deleted file mode 100755
index f8b98801..00000000
--- a/examples/computecloth/computecloth.cpp
+++ /dev/null
@@ -1,768 +0,0 @@
-/*
-* Vulkan Example - Compute shader cloth simulation
-*
-* A compute shader updates a shader storage buffer that contains particles held together by springs and also does basic
-* collision detection against a sphere. This storage buffer is then used as the vertex input for the graphics part of the sample
-*
-* Copyright (C) 2016-2025 by Sascha Willems - www.saschawillems.de
-*
-* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
-*/
-
-#include "vulkanexamplebase.h"
-#include "VulkanglTFModel.h"
-
-
-class VulkanExample : public VulkanExampleBase
-{
-public:
- uint32_t readSet{ 0 };
- uint32_t indexCount{ 0 };
- bool simulateWind{ false };
- // This will be set to true, if the device has a dedicated queue from a compute only queue family
- // With such a queue graphics and compute workloads can run in parallel, but this also requires additional barriers (often called "async compute")
- // These barriers will release and acquire the resources used in graphics and compute between the different queue families
- bool dedicatedComputeQueue{ false };
-
- vks::Texture2D textureCloth;
- vkglTF::Model modelSphere;
-
- // The cloth is made from a grid of particles
- struct Particle {
- glm::vec4 pos;
- glm::vec4 vel;
- glm::vec4 uv;
- glm::vec4 normal;
- };
-
- // Cloth definition parameters
- struct Cloth {
- glm::uvec2 gridsize{ 60, 60 };
- glm::vec2 size{ 5.0f, 5.0f };
- } cloth;
-
- // We put the resource "types" into structs to make this sample easier to understand
-
- // We use two buffers for our cloth simulation: One with the input cloth data and one for outputting updated values
- // The compute pipeline will update the output buffer, and the graphics pipeline will it as a vertex buffer
- struct StorageBuffers {
- vks::Buffer input;
- vks::Buffer output;
- } storageBuffers;
-
- // Resources for the graphics part of the example
- struct Graphics {
- VkDescriptorSetLayout descriptorSetLayout{ VK_NULL_HANDLE };
- VkDescriptorSet descriptorSet{ VK_NULL_HANDLE };
- VkPipelineLayout pipelineLayout{ VK_NULL_HANDLE };
- struct Pipelines {
- VkPipeline cloth{ VK_NULL_HANDLE };
- VkPipeline sphere{ VK_NULL_HANDLE };
- } pipelines;
- // The vertices will be stored in the shader storage buffers, so we only need an index buffer in this structure
- vks::Buffer indices;
- struct UniformData {
- glm::mat4 projection;
- glm::mat4 view;
- glm::vec4 lightPos{ -2.0f, 4.0f, -2.0f, 1.0f };
- } uniformData;
- vks::Buffer uniformBuffer;
- } graphics;
-
- // Resources for the compute part of the example
- // Number of compute command buffers: set to 1 for serialized processing or 2 for in-parallel with graphics queue
- static constexpr size_t computeCommandBufferCount = 2 ;
- struct Compute {
- typedef struct Semaphores_t {
- VkSemaphore ready{ VK_NULL_HANDLE };
- VkSemaphore complete{ VK_NULL_HANDLE };
- } semaphores_t;
- std::array semaphores{};
- VkQueue queue{ VK_NULL_HANDLE };
- VkCommandPool commandPool{ VK_NULL_HANDLE };
- std::array commandBuffers{};
- VkDescriptorSetLayout descriptorSetLayout{ VK_NULL_HANDLE };
- std::array descriptorSets{ VK_NULL_HANDLE };
- VkPipelineLayout pipelineLayout{ VK_NULL_HANDLE };
- VkPipeline pipeline{ VK_NULL_HANDLE };
- struct UniformData {
- float deltaT{ 0.0f };
- // These arguments define the spring setup for the cloth piece
- // Changing these changes how the cloth reacts
- float particleMass{ 0.1f };
- float springStiffness{ 2000.0f };
- float damping{ 0.25f };
- float restDistH{ 0 };
- float restDistV{ 0 };
- float restDistD{ 0 };
- float sphereRadius{ 1.0f };
- glm::vec4 spherePos{ 0.0f, 0.0f, 0.0f, 0.0f };
- glm::vec4 gravity{ 0.0f, 9.8f, 0.0f, 0.0f };
- glm::ivec2 particleCount{ 0 };
- } uniformData;
- vks::Buffer uniformBuffer;
- } compute;
-
- VulkanExample() : VulkanExampleBase()
- {
- title = "Compute shader cloth simulation";
- camera.type = Camera::CameraType::lookat;
- camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
- camera.setRotation(glm::vec3(-30.0f, -45.0f, 0.0f));
- camera.setTranslation(glm::vec3(0.0f, 0.0f, -5.0f));
- }
-
- ~VulkanExample()
- {
- if (device) {
- // Graphics
- graphics.indices.destroy();
- graphics.uniformBuffer.destroy();
- vkDestroyPipeline(device, graphics.pipelines.cloth, nullptr);
- vkDestroyPipeline(device, graphics.pipelines.sphere, nullptr);
- vkDestroyPipelineLayout(device, graphics.pipelineLayout, nullptr);
- vkDestroyDescriptorSetLayout(device, graphics.descriptorSetLayout, nullptr);
- textureCloth.destroy();
-
- // Compute
- compute.uniformBuffer.destroy();
- vkDestroyPipelineLayout(device, compute.pipelineLayout, nullptr);
- vkDestroyDescriptorSetLayout(device, compute.descriptorSetLayout, nullptr);
- vkDestroyPipeline(device, compute.pipeline, nullptr);
- for (uint32_t i = 0; i < compute.semaphores.size(); i++) {
- vkDestroySemaphore(device, compute.semaphores[i].ready, nullptr);
- vkDestroySemaphore(device, compute.semaphores[i].complete, nullptr);
- }
- vkDestroyCommandPool(device, compute.commandPool, nullptr);
-
- // SSBOs
- storageBuffers.input.destroy();
- storageBuffers.output.destroy();
- }
- }
-
- // Enable physical device features required for this example
- virtual void getEnabledFeatures()
- {
- if (deviceFeatures.samplerAnisotropy) {
- enabledFeatures.samplerAnisotropy = VK_TRUE;
- }
- };
-
- void loadAssets()
- {
- const uint32_t glTFLoadingFlags = vkglTF::FileLoadingFlags::PreTransformVertices | vkglTF::FileLoadingFlags::PreMultiplyVertexColors | vkglTF::FileLoadingFlags::FlipY;
- modelSphere.loadFromFile(getAssetPath() + "models/sphere.gltf", vulkanDevice, queue, glTFLoadingFlags);
- textureCloth.loadFromFile(getAssetPath() + "textures/vulkan_cloth_rgba.ktx", VK_FORMAT_R8G8B8A8_UNORM, vulkanDevice, queue);
- }
-
- void addGraphicsToComputeBarriers(VkCommandBuffer commandBuffer, VkAccessFlags srcAccessMask, VkAccessFlags dstAccessMask, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask)
- {
- if (dedicatedComputeQueue) {
- VkBufferMemoryBarrier bufferBarrier = vks::initializers::bufferMemoryBarrier();
- bufferBarrier.srcAccessMask = srcAccessMask;
- bufferBarrier.dstAccessMask = dstAccessMask;
- bufferBarrier.srcQueueFamilyIndex = vulkanDevice->queueFamilyIndices.graphics;
- bufferBarrier.dstQueueFamilyIndex = vulkanDevice->queueFamilyIndices.compute;
- bufferBarrier.size = VK_WHOLE_SIZE;
-
- std::vector bufferBarriers;
- bufferBarrier.buffer = storageBuffers.input.buffer;
- bufferBarriers.push_back(bufferBarrier);
- bufferBarrier.buffer = storageBuffers.output.buffer;
- bufferBarriers.push_back(bufferBarrier);
- vkCmdPipelineBarrier(commandBuffer,
- srcStageMask,
- dstStageMask,
- VK_FLAGS_NONE,
- 0, nullptr,
- static_cast(bufferBarriers.size()), bufferBarriers.data(),
- 0, nullptr);
- }
- }
-
- void addComputeToComputeBarriers(VkCommandBuffer commandBuffer, uint32_t readSet)
- {
- VkBufferMemoryBarrier bufferBarrier = vks::initializers::bufferMemoryBarrier();
- bufferBarrier.srcAccessMask = VK_ACCESS_SHADER_WRITE_BIT;
- bufferBarrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
- bufferBarrier.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
- bufferBarrier.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED;
- bufferBarrier.size = VK_WHOLE_SIZE;
- std::vector bufferBarriers;
- if (readSet == 0)
- {
- // SRS - we have written to output.buffer and need a memory barrier before reading it
- // - don't need a memory barrier for input.buffer, the execution barrier is enough
- bufferBarrier.buffer = storageBuffers.output.buffer;
- bufferBarriers.push_back(bufferBarrier);
- }
- else //if (readSet == 1)
- {
- // SRS - we have written to input.buffer and need a memory barrier before reading it
- // - don't need a memory barrier for output.buffer, the execution barrier is enough
- bufferBarrier.buffer = storageBuffers.input.buffer;
- bufferBarriers.push_back(bufferBarrier);
- }
- vkCmdPipelineBarrier(
- commandBuffer,
- VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
- VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
- VK_FLAGS_NONE,
- 0, nullptr,
- static_cast(bufferBarriers.size()), bufferBarriers.data(),
- 0, nullptr);
- }
-
- void addComputeToGraphicsBarriers(VkCommandBuffer commandBuffer, VkAccessFlags srcAccessMask, VkAccessFlags dstAccessMask, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask)
- {
- if (dedicatedComputeQueue) {
- VkBufferMemoryBarrier bufferBarrier = vks::initializers::bufferMemoryBarrier();
- bufferBarrier.srcAccessMask = srcAccessMask;
- bufferBarrier.dstAccessMask = dstAccessMask;
- bufferBarrier.srcQueueFamilyIndex = vulkanDevice->queueFamilyIndices.compute;
- bufferBarrier.dstQueueFamilyIndex = vulkanDevice->queueFamilyIndices.graphics;
- bufferBarrier.size = VK_WHOLE_SIZE;
- std::vector bufferBarriers;
- bufferBarrier.buffer = storageBuffers.input.buffer;
- bufferBarriers.push_back(bufferBarrier);
- bufferBarrier.buffer = storageBuffers.output.buffer;
- bufferBarriers.push_back(bufferBarrier);
- vkCmdPipelineBarrier(
- commandBuffer,
- srcStageMask,
- dstStageMask,
- VK_FLAGS_NONE,
- 0, nullptr,
- static_cast(bufferBarriers.size()), bufferBarriers.data(),
- 0, nullptr);
- }
- }
-
- void buildCommandBuffers()
- {
- VkCommandBufferBeginInfo cmdBufInfo = vks::initializers::commandBufferBeginInfo();
-
- VkClearValue clearValues[2];
- clearValues[0].color = { { 0.0f, 0.0f, 0.0f, 1.0f } };
- clearValues[1].depthStencil = { 1.0f, 0 };
-
- VkRenderPassBeginInfo renderPassBeginInfo = vks::initializers::renderPassBeginInfo();
- renderPassBeginInfo.renderPass = renderPass;
- renderPassBeginInfo.renderArea.offset.x = 0;
- renderPassBeginInfo.renderArea.offset.y = 0;
- renderPassBeginInfo.renderArea.extent.width = width;
- renderPassBeginInfo.renderArea.extent.height = height;
- renderPassBeginInfo.clearValueCount = 2;
- renderPassBeginInfo.pClearValues = clearValues;
-
- for (int32_t i = 0; i < drawCmdBuffers.size(); ++i)
- {
- // Set target frame buffer
- renderPassBeginInfo.framebuffer = frameBuffers[i];
-
- VK_CHECK_RESULT(vkBeginCommandBuffer(drawCmdBuffers[i], &cmdBufInfo));
-
- // Acquire storage buffers from compute queue
- addComputeToGraphicsBarriers(drawCmdBuffers[i], 0, VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_VERTEX_INPUT_BIT);
-
- // Draw the particle system using the update vertex buffer
-
- vkCmdBeginRenderPass(drawCmdBuffers[i], &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
-
- VkViewport viewport = vks::initializers::viewport((float)width, (float)height, 0.0f, 1.0f);
- vkCmdSetViewport(drawCmdBuffers[i], 0, 1, &viewport);
-
- VkRect2D scissor = vks::initializers::rect2D(width, height, 0, 0);
- vkCmdSetScissor(drawCmdBuffers[i], 0, 1, &scissor);
-
- VkDeviceSize offsets[1] = { 0 };
-
- // Render sphere
- vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, graphics.pipelines.sphere);
- vkCmdBindDescriptorSets(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, graphics.pipelineLayout, 0, 1, &graphics.descriptorSet, 0, NULL);
- modelSphere.draw(drawCmdBuffers[i]);
-
- // Render cloth
- vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, graphics.pipelines.cloth);
- vkCmdBindDescriptorSets(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, graphics.pipelineLayout, 0, 1, &graphics.descriptorSet, 0, NULL);
- vkCmdBindIndexBuffer(drawCmdBuffers[i], graphics.indices.buffer, 0, VK_INDEX_TYPE_UINT32);
- vkCmdBindVertexBuffers(drawCmdBuffers[i], 0, 1, &storageBuffers.output.buffer, offsets);
- vkCmdDrawIndexed(drawCmdBuffers[i], indexCount, 1, 0, 0, 0);
-
- drawUI(drawCmdBuffers[i]);
-
- vkCmdEndRenderPass(drawCmdBuffers[i]);
-
- // release the storage buffers to the compute queue
- addGraphicsToComputeBarriers(drawCmdBuffers[i], VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, 0, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT);
-
- VK_CHECK_RESULT(vkEndCommandBuffer(drawCmdBuffers[i]));
- }
-
- }
-
- void buildComputeCommandBuffer()
- {
- VkCommandBufferBeginInfo cmdBufInfo = vks::initializers::commandBufferBeginInfo();
- cmdBufInfo.flags = VK_COMMAND_BUFFER_USAGE_SIMULTANEOUS_USE_BIT;
-
- for (uint32_t i = 0; i < compute.commandBuffers.size(); i++) {
-
- VK_CHECK_RESULT(vkBeginCommandBuffer(compute.commandBuffers[i], &cmdBufInfo));
-
- // Acquire the storage buffers from the graphics queue
- addGraphicsToComputeBarriers(compute.commandBuffers[i], 0, VK_ACCESS_SHADER_READ_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT);
-
- vkCmdBindPipeline(compute.commandBuffers[i], VK_PIPELINE_BIND_POINT_COMPUTE, compute.pipeline);
-
- uint32_t calculateNormals = 0;
- vkCmdPushConstants(compute.commandBuffers[i], compute.pipelineLayout, VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(uint32_t), &calculateNormals);
-
- // Dispatch the compute job
- // SRS - Iterations **must** be an even number, so that readSet starts at 1 and the final result ends up in output.buffer with readSet equal to 0
- const uint32_t iterations = 64;
- for (uint32_t j = 0; j < iterations; j++) {
- readSet = 1 - readSet;
- vkCmdBindDescriptorSets(compute.commandBuffers[i], VK_PIPELINE_BIND_POINT_COMPUTE, compute.pipelineLayout, 0, 1, &compute.descriptorSets[readSet], 0, 0);
-
- if (j == iterations - 1) {
- calculateNormals = 1;
- vkCmdPushConstants(compute.commandBuffers[i], compute.pipelineLayout, VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(uint32_t), &calculateNormals);
- }
-
- vkCmdDispatch(compute.commandBuffers[i], cloth.gridsize.x / 10, cloth.gridsize.y / 10, 1);
-
- // Don't add a barrier on the last iteration of the loop, since we'll have an explicit release to the graphics queue
- if (j != iterations - 1) {
- addComputeToComputeBarriers(compute.commandBuffers[i], readSet);
- }
-
- }
-
- // release the storage buffers back to the graphics queue
- addComputeToGraphicsBarriers(compute.commandBuffers[i], VK_ACCESS_SHADER_WRITE_BIT, 0, VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT);
- vkEndCommandBuffer(compute.commandBuffers[i]);
- }
- }
-
- // Setup and fill the shader storage buffers containing the particles
- // These buffers are used as shader storage buffers in the compute shader (to update them) and as vertex input in the vertex shader (to display them)
- void prepareStorageBuffers()
- {
- std::vector particleBuffer(cloth.gridsize.x * cloth.gridsize.y);
-
- float dx = cloth.size.x / (cloth.gridsize.x - 1);
- float dy = cloth.size.y / (cloth.gridsize.y - 1);
- float du = 1.0f / (cloth.gridsize.x - 1);
- float dv = 1.0f / (cloth.gridsize.y - 1);
-
- // Set up a flat cloth that falls onto sphere
- glm::mat4 transM = glm::translate(glm::mat4(1.0f), glm::vec3(-cloth.size.x / 2.0f, -2.0f, -cloth.size.y / 2.0f));
- for (uint32_t i = 0; i < cloth.gridsize.y; i++) {
- for (uint32_t j = 0; j < cloth.gridsize.x; j++) {
- particleBuffer[i + j * cloth.gridsize.y].pos = transM * glm::vec4(dx * j, 0.0f, dy * i, 1.0f);
- particleBuffer[i + j * cloth.gridsize.y].vel = glm::vec4(0.0f);
- particleBuffer[i + j * cloth.gridsize.y].uv = glm::vec4(1.0f - du * i, dv * j, 0.0f, 0.0f);
- }
- }
-
- VkDeviceSize storageBufferSize = particleBuffer.size() * sizeof(Particle);
-
- // Staging
- // SSBO won't be changed on the host after upload so copy to device local memory
-
- vks::Buffer stagingBuffer;
-
- vulkanDevice->createBuffer(
- VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
- VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
- &stagingBuffer,
- storageBufferSize,
- particleBuffer.data());
-
- // SSBOs will be used both as storage buffers (compute) and vertex buffers (graphics)
- vulkanDevice->createBuffer(
- VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT,
- VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
- &storageBuffers.input,
- storageBufferSize);
-
- vulkanDevice->createBuffer(
- VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT,
- VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
- &storageBuffers.output,
- storageBufferSize);
-
- // Copy from staging buffer
- VkCommandBuffer copyCmd = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
- VkBufferCopy copyRegion = {};
- copyRegion.size = storageBufferSize;
- vkCmdCopyBuffer(copyCmd, stagingBuffer.buffer, storageBuffers.output.buffer, 1, ©Region);
- // Add an initial release barrier to the graphics queue,
- // so that when the compute command buffer executes for the first time
- // it doesn't complain about a lack of a corresponding "release" to its "acquire"
- addGraphicsToComputeBarriers(copyCmd, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, 0, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT);
- vulkanDevice->flushCommandBuffer(copyCmd, queue, true);
-
- stagingBuffer.destroy();
-
- // Indices
- std::vector indices;
- for (uint32_t y = 0; y < cloth.gridsize.y - 1; y++) {
- for (uint32_t x = 0; x < cloth.gridsize.x; x++) {
- indices.push_back((y + 1) * cloth.gridsize.x + x);
- indices.push_back((y)*cloth.gridsize.x + x);
- }
- // Primitive restart (signaled by special value 0xFFFFFFFF)
- indices.push_back(0xFFFFFFFF);
- }
- uint32_t indexBufferSize = static_cast(indices.size()) * sizeof(uint32_t);
- indexCount = static_cast(indices.size());
-
- vulkanDevice->createBuffer(
- VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
- VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
- &stagingBuffer,
- indexBufferSize,
- indices.data());
-
- vulkanDevice->createBuffer(
- VK_BUFFER_USAGE_INDEX_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT,
- VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
- &graphics.indices,
- indexBufferSize);
-
- // Copy from staging buffer
- copyCmd = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
- copyRegion = {};
- copyRegion.size = indexBufferSize;
- vkCmdCopyBuffer(copyCmd, stagingBuffer.buffer, graphics.indices.buffer, 1, ©Region);
- vulkanDevice->flushCommandBuffer(copyCmd, queue, true);
-
- stagingBuffer.destroy();
- }
-
- // Prepare the resources used for the graphics part of the sample
- void prepareGraphics()
- {
- // Uniform buffer for passing data to the vertex shader
- vulkanDevice->createBuffer(VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, &graphics.uniformBuffer, sizeof(Graphics::UniformData));
- VK_CHECK_RESULT(graphics.uniformBuffer.map());
-
- // Descriptor pool
- std::vector poolSizes = {
- vks::initializers::descriptorPoolSize(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 3),
- vks::initializers::descriptorPoolSize(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 4),
- vks::initializers::descriptorPoolSize(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 2)
- };
- VkDescriptorPoolCreateInfo descriptorPoolInfo = vks::initializers::descriptorPoolCreateInfo(poolSizes, 3);
- VK_CHECK_RESULT(vkCreateDescriptorPool(device, &descriptorPoolInfo, nullptr, &descriptorPool));
-
- // Descriptor layout
- std::vector setLayoutBindings = {
- vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_SHADER_STAGE_VERTEX_BIT, 0),
- vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_SHADER_STAGE_FRAGMENT_BIT, 1)
- };
- VkDescriptorSetLayoutCreateInfo descriptorLayout = vks::initializers::descriptorSetLayoutCreateInfo(setLayoutBindings);
- VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device, &descriptorLayout, nullptr, &graphics.descriptorSetLayout));
-
- // Decscriptor set
- VkDescriptorSetAllocateInfo allocInfo = vks::initializers::descriptorSetAllocateInfo(descriptorPool, &graphics.descriptorSetLayout, 1);
- VK_CHECK_RESULT(vkAllocateDescriptorSets(device, &allocInfo, &graphics.descriptorSet));
- std::vector writeDescriptorSets = {
- vks::initializers::writeDescriptorSet(graphics.descriptorSet, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 0, &graphics.uniformBuffer.descriptor),
- vks::initializers::writeDescriptorSet(graphics.descriptorSet, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, &textureCloth.descriptor)
- };
- vkUpdateDescriptorSets(device, static_cast(writeDescriptorSets.size()), writeDescriptorSets.data(), 0, nullptr);
-
- // Layout
- VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vks::initializers::pipelineLayoutCreateInfo(&graphics.descriptorSetLayout, 1);
- VK_CHECK_RESULT(vkCreatePipelineLayout(device, &pipelineLayoutCreateInfo, nullptr, &graphics.pipelineLayout));
-
- // Pipeline
- VkPipelineInputAssemblyStateCreateInfo inputAssemblyState = vks::initializers::pipelineInputAssemblyStateCreateInfo(VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP, 0, VK_TRUE);
- VkPipelineRasterizationStateCreateInfo rasterizationState = vks::initializers::pipelineRasterizationStateCreateInfo(VK_POLYGON_MODE_FILL, VK_CULL_MODE_NONE, VK_FRONT_FACE_COUNTER_CLOCKWISE, 0);
- VkPipelineColorBlendAttachmentState blendAttachmentState = vks::initializers::pipelineColorBlendAttachmentState(0xf, VK_FALSE);
- VkPipelineColorBlendStateCreateInfo colorBlendState = vks::initializers::pipelineColorBlendStateCreateInfo(1, &blendAttachmentState);
- VkPipelineDepthStencilStateCreateInfo depthStencilState = vks::initializers::pipelineDepthStencilStateCreateInfo(VK_TRUE, VK_TRUE, VK_COMPARE_OP_LESS_OR_EQUAL);
- VkPipelineViewportStateCreateInfo viewportState = vks::initializers::pipelineViewportStateCreateInfo(1, 1, 0);
- VkPipelineMultisampleStateCreateInfo multisampleState = vks::initializers::pipelineMultisampleStateCreateInfo(VK_SAMPLE_COUNT_1_BIT, 0);
- std::vector dynamicStateEnables = { VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR };
- VkPipelineDynamicStateCreateInfo dynamicState = vks::initializers::pipelineDynamicStateCreateInfo(dynamicStateEnables);
-
- // Rendering pipeline
- std::array shaderStages = {
- loadShader(getShadersPath() + "computecloth/cloth.vert.spv", VK_SHADER_STAGE_VERTEX_BIT),
- loadShader(getShadersPath() + "computecloth/cloth.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT)
- };
-
- VkGraphicsPipelineCreateInfo pipelineCreateInfo = vks::initializers::pipelineCreateInfo(graphics.pipelineLayout, renderPass);
-
- // Vertex Input
- std::vector inputBindings = {
- vks::initializers::vertexInputBindingDescription(0, sizeof(Particle), VK_VERTEX_INPUT_RATE_VERTEX)
- };
- // Attribute descriptions based on the particles of the cloth
- std::vector inputAttributes = {
- vks::initializers::vertexInputAttributeDescription(0, 0, VK_FORMAT_R32G32B32_SFLOAT, offsetof(Particle, pos)),
- vks::initializers::vertexInputAttributeDescription(0, 1, VK_FORMAT_R32G32_SFLOAT, offsetof(Particle, uv)),
- vks::initializers::vertexInputAttributeDescription(0, 2, VK_FORMAT_R32G32B32_SFLOAT, offsetof(Particle, normal))
- };
-
- // Assign to vertex buffer
- VkPipelineVertexInputStateCreateInfo inputState = vks::initializers::pipelineVertexInputStateCreateInfo();
- inputState.vertexBindingDescriptionCount = static_cast(inputBindings.size());
- inputState.pVertexBindingDescriptions = inputBindings.data();
- inputState.vertexAttributeDescriptionCount = static_cast(inputAttributes.size());
- inputState.pVertexAttributeDescriptions = inputAttributes.data();
-
- pipelineCreateInfo.pVertexInputState = &inputState;
- pipelineCreateInfo.pInputAssemblyState = &inputAssemblyState;
- pipelineCreateInfo.pRasterizationState = &rasterizationState;
- pipelineCreateInfo.pColorBlendState = &colorBlendState;
- pipelineCreateInfo.pMultisampleState = &multisampleState;
- pipelineCreateInfo.pViewportState = &viewportState;
- pipelineCreateInfo.pDepthStencilState = &depthStencilState;
- pipelineCreateInfo.pDynamicState = &dynamicState;
- pipelineCreateInfo.stageCount = static_cast(shaderStages.size());
- pipelineCreateInfo.pStages = shaderStages.data();
- pipelineCreateInfo.renderPass = renderPass;
- VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCreateInfo, nullptr, &graphics.pipelines.cloth));
-
- // Sphere rendering pipeline
- pipelineCreateInfo.pVertexInputState = vkglTF::Vertex::getPipelineVertexInputState({ vkglTF::VertexComponent::Position, vkglTF::VertexComponent::UV, vkglTF::VertexComponent::Normal });
- inputState.vertexAttributeDescriptionCount = static_cast(inputAttributes.size());
- inputAssemblyState.topology = VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST;
- inputAssemblyState.primitiveRestartEnable = VK_FALSE;
- rasterizationState.polygonMode = VK_POLYGON_MODE_FILL;
- shaderStages = {
- loadShader(getShadersPath() + "computecloth/sphere.vert.spv", VK_SHADER_STAGE_VERTEX_BIT),
- loadShader(getShadersPath() + "computecloth/sphere.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT)
- };
- VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCreateInfo, nullptr, &graphics.pipelines.sphere));
-
- buildCommandBuffers();
- }
-
- // Prepare the resources used for the compute part of the sample
- void prepareCompute()
- {
- // Create a compute capable device queue
- vkGetDeviceQueue(device, vulkanDevice->queueFamilyIndices.compute, 0, &compute.queue);
-
- // Uniform buffer for passing data to the compute shader
- vulkanDevice->createBuffer(VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, &compute.uniformBuffer, sizeof(Compute::UniformData));
- VK_CHECK_RESULT(compute.uniformBuffer.map());
-
- // Set some initial values
- float dx = cloth.size.x / (cloth.gridsize.x - 1);
- float dy = cloth.size.y / (cloth.gridsize.y - 1);
-
- compute.uniformData.restDistH = dx;
- compute.uniformData.restDistV = dy;
- compute.uniformData.restDistD = sqrtf(dx * dx + dy * dy);
- compute.uniformData.particleCount = cloth.gridsize;
-
- // Create compute pipeline
- std::vector setLayoutBindings = {
- vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, VK_SHADER_STAGE_COMPUTE_BIT, 0),
- vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, VK_SHADER_STAGE_COMPUTE_BIT, 1),
- vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_SHADER_STAGE_COMPUTE_BIT, 2),
- };
-
- VkDescriptorSetLayoutCreateInfo descriptorLayout = vks::initializers::descriptorSetLayoutCreateInfo(setLayoutBindings);
- VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device, &descriptorLayout, nullptr, &compute.descriptorSetLayout));
-
- VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vks::initializers::pipelineLayoutCreateInfo(&compute.descriptorSetLayout, 1);
-
- // Push constants used to pass some parameters
- VkPushConstantRange pushConstantRange = vks::initializers::pushConstantRange(VK_SHADER_STAGE_COMPUTE_BIT, sizeof(uint32_t), 0);
- pipelineLayoutCreateInfo.pushConstantRangeCount = 1;
- pipelineLayoutCreateInfo.pPushConstantRanges = &pushConstantRange;
- VK_CHECK_RESULT(vkCreatePipelineLayout(device, &pipelineLayoutCreateInfo, nullptr, &compute.pipelineLayout));
-
- VkDescriptorSetAllocateInfo allocInfo = vks::initializers::descriptorSetAllocateInfo(descriptorPool, &compute.descriptorSetLayout, 1);
-
- // Create two descriptor sets with input and output buffers switched
- VK_CHECK_RESULT(vkAllocateDescriptorSets(device, &allocInfo, &compute.descriptorSets[0]));
- VK_CHECK_RESULT(vkAllocateDescriptorSets(device, &allocInfo, &compute.descriptorSets[1]));
-
- std::vector computeWriteDescriptorSets = {
- vks::initializers::writeDescriptorSet(compute.descriptorSets[0], VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 0, &storageBuffers.input.descriptor),
- vks::initializers::writeDescriptorSet(compute.descriptorSets[0], VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, &storageBuffers.output.descriptor),
- vks::initializers::writeDescriptorSet(compute.descriptorSets[0], VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 2, &compute.uniformBuffer.descriptor),
-
- vks::initializers::writeDescriptorSet(compute.descriptorSets[1], VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 0, &storageBuffers.output.descriptor),
- vks::initializers::writeDescriptorSet(compute.descriptorSets[1], VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 1, &storageBuffers.input.descriptor),
- vks::initializers::writeDescriptorSet(compute.descriptorSets[1], VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 2, &compute.uniformBuffer.descriptor)
- };
-
- vkUpdateDescriptorSets(device, static_cast(computeWriteDescriptorSets.size()), computeWriteDescriptorSets.data(), 0, NULL);
-
- // Create pipeline
- VkComputePipelineCreateInfo computePipelineCreateInfo = vks::initializers::computePipelineCreateInfo(compute.pipelineLayout, 0);
- computePipelineCreateInfo.stage = loadShader(getShadersPath() + "computecloth/cloth.comp.spv", VK_SHADER_STAGE_COMPUTE_BIT);
- VK_CHECK_RESULT(vkCreateComputePipelines(device, pipelineCache, 1, &computePipelineCreateInfo, nullptr, &compute.pipeline));
-
- // Separate command pool as queue family for compute may be different than graphics
- VkCommandPoolCreateInfo cmdPoolInfo = {};
- cmdPoolInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
- cmdPoolInfo.queueFamilyIndex = vulkanDevice->queueFamilyIndices.compute;
- cmdPoolInfo.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT;
- VK_CHECK_RESULT(vkCreateCommandPool(device, &cmdPoolInfo, nullptr, &compute.commandPool));
-
- // Create a command buffer for compute operations
- VkCommandBufferAllocateInfo cmdBufAllocateInfo = vks::initializers::commandBufferAllocateInfo(compute.commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY, static_cast(compute.commandBuffers.size()));
- VK_CHECK_RESULT(vkAllocateCommandBuffers(device, &cmdBufAllocateInfo, &compute.commandBuffers[0]));
-
- // Semaphores for graphics / compute synchronization
- VkSemaphoreCreateInfo semaphoreCreateInfo = vks::initializers::semaphoreCreateInfo();
- for (uint32_t i = 0; i < compute.semaphores.size(); i++) {
- VK_CHECK_RESULT(vkCreateSemaphore(device, &semaphoreCreateInfo, nullptr, &compute.semaphores[i].ready));
- VK_CHECK_RESULT(vkCreateSemaphore(device, &semaphoreCreateInfo, nullptr, &compute.semaphores[i].complete));
- }
-
- // Build a single command buffer containing the compute dispatch commands
- buildComputeCommandBuffer();
- }
-
- void updateComputeUBO()
- {
- if (!paused) {
- // SRS - Clamp frameTimer to max 20ms refresh period (e.g. if blocked on resize), otherwise image breakup can occur
- compute.uniformData.deltaT = fmin(frameTimer, 0.02f) * 0.0025f;
-
- if (simulateWind) {
- std::default_random_engine rndEngine(benchmark.active ? 0 : (unsigned)time(nullptr));
- std::uniform_real_distribution rd(1.0f, 12.0f);
- compute.uniformData.gravity.x = cos(glm::radians(-timer * 360.0f)) * (rd(rndEngine) - rd(rndEngine));
- compute.uniformData.gravity.z = sin(glm::radians(timer * 360.0f)) * (rd(rndEngine) - rd(rndEngine));
- }
- else {
- compute.uniformData.gravity.x = 0.0f;
- compute.uniformData.gravity.z = 0.0f;
- }
- }
- else {
- compute.uniformData.deltaT = 0.0f;
- }
- memcpy(compute.uniformBuffer.mapped, &compute.uniformData, sizeof(Compute::UniformData));
- }
-
- void updateGraphicsUBO()
- {
- graphics.uniformData.projection = camera.matrices.perspective;
- graphics.uniformData.view = camera.matrices.view;
- memcpy(graphics.uniformBuffer.mapped, &graphics.uniformData, sizeof(Graphics::UniformData));
- }
-
- void draw()
- {
- // As we use both graphics and compute, frame submission is a bit more involved
- // We'll be using semaphores to synchronize between the compute shader updating the cloth and the graphics pipeline drawing it
-
- static bool firstDraw = true;
- static uint32_t computeSubmitIndex{ 0 }, graphicsSubmitIndex{ 0 };
- if (computeCommandBufferCount > 1)
- {
- // SRS - if we are double buffering the compute queue, swap the compute command buffer indices
- graphicsSubmitIndex = computeSubmitIndex;
- computeSubmitIndex = 1 - graphicsSubmitIndex;
- }
-
- VkSubmitInfo computeSubmitInfo = vks::initializers::submitInfo();
- VkPipelineStageFlags computeWaitDstStageMask = VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT;
- if (!firstDraw) {
- computeSubmitInfo.waitSemaphoreCount = 1;
- computeSubmitInfo.pWaitSemaphores = &compute.semaphores[computeSubmitIndex].ready;
- computeSubmitInfo.pWaitDstStageMask = &computeWaitDstStageMask;
- }
- else {
- firstDraw = false;
- if (computeCommandBufferCount > 1)
- {
- // SRS - if we are double buffering the compute queue, submit extra command buffer at start
- computeSubmitInfo.signalSemaphoreCount = 1;
- computeSubmitInfo.pSignalSemaphores = &compute.semaphores[graphicsSubmitIndex].complete;
- computeSubmitInfo.commandBufferCount = 1;
- computeSubmitInfo.pCommandBuffers = &compute.commandBuffers[graphicsSubmitIndex];
-
- VK_CHECK_RESULT(vkQueueSubmit(compute.queue, 1, &computeSubmitInfo, VK_NULL_HANDLE));
-
- // Add an extra set of acquire and release barriers to the graphics queue,
- // so that when the second compute command buffer executes for the first time
- // it doesn't complain about a lack of a corresponding "acquire" to its "release" and vice versa
- VkCommandBuffer barrierCmd = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
- addComputeToGraphicsBarriers(barrierCmd, 0, VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_VERTEX_INPUT_BIT);
- addGraphicsToComputeBarriers(barrierCmd, VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT, 0, VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT);
- vulkanDevice->flushCommandBuffer(barrierCmd, queue, true);
- }
- }
- computeSubmitInfo.signalSemaphoreCount = 1;
- computeSubmitInfo.pSignalSemaphores = &compute.semaphores[computeSubmitIndex].complete;
- computeSubmitInfo.commandBufferCount = 1;
- computeSubmitInfo.pCommandBuffers = &compute.commandBuffers[computeSubmitIndex];
-
- VK_CHECK_RESULT(vkQueueSubmit(compute.queue, 1, &computeSubmitInfo, VK_NULL_HANDLE));
-
- // Submit graphics commands
- VulkanExampleBase::prepareFrame();
-
- VkPipelineStageFlags waitDstStageMask[2] = {
- submitPipelineStages, VK_PIPELINE_STAGE_VERTEX_INPUT_BIT
- };
- VkSemaphore waitSemaphores[2] = {
- semaphores.presentComplete, compute.semaphores[graphicsSubmitIndex].complete
- };
- VkSemaphore signalSemaphores[2] = {
- semaphores.renderComplete, compute.semaphores[graphicsSubmitIndex].ready
- };
-
- submitInfo.waitSemaphoreCount = 2;
- submitInfo.pWaitDstStageMask = waitDstStageMask;
- submitInfo.pWaitSemaphores = waitSemaphores;
- submitInfo.signalSemaphoreCount = 2;
- submitInfo.pSignalSemaphores = signalSemaphores;
- submitInfo.commandBufferCount = 1;
- submitInfo.pCommandBuffers = &drawCmdBuffers[currentBuffer];
- VK_CHECK_RESULT(vkQueueSubmit(queue, 1, &submitInfo, VK_NULL_HANDLE));
-
- VulkanExampleBase::submitFrame();
- }
-
- void prepare()
- {
- VulkanExampleBase::prepare();
- // Make sure the code works properly both with different queues families for graphics and compute and the same queue family
- // You can use DEBUG_FORCE_SHARED_GRAPHICS_COMPUTE_QUEUE preprocessor define to force graphics and compute from the same queue family
-#ifdef DEBUG_FORCE_SHARED_GRAPHICS_COMPUTE_QUEUE
- vulkanDevice->queueFamilyIndices.compute = vulkanDevice->queueFamilyIndices.graphics;
-#endif
- // Check whether the compute queue family is distinct from the graphics queue family
- dedicatedComputeQueue = vulkanDevice->queueFamilyIndices.graphics != vulkanDevice->queueFamilyIndices.compute;
- loadAssets();
- prepareStorageBuffers();
- prepareGraphics();
- prepareCompute();
- prepared = true;
- }
-
- virtual void render()
- {
- if (!prepared)
- return;
- updateGraphicsUBO();
- updateComputeUBO();
- draw();
- }
-
- virtual void OnUpdateUIOverlay(vks::UIOverlay* overlay)
- {
- if (overlay->header("Settings")) {
- overlay->checkBox("Simulate wind", &simulateWind);
- }
- }
-};
-
-VULKAN_EXAMPLE_MAIN()
diff --git a/examples/computecullandlod/computecullandlod.cpp b/examples/computecullandlod/computecullandlod.cpp
deleted file mode 100644
index 82a829e8..00000000
--- a/examples/computecullandlod/computecullandlod.cpp
+++ /dev/null
@@ -1,822 +0,0 @@
-/*
-* Vulkan Example - Compute shader culling and LOD using indirect rendering
-*
-* Copyright (C) 2016-2025 by Sascha Willems - www.saschawillems.de
-*
-* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
-*
-*/
-
-#include "vulkanexamplebase.h"
-#include "VulkanglTFModel.h"
-#include "frustum.hpp"
-
-
-// Total number of objects (^3) in the scene
-#if defined(__ANDROID__)
-constexpr auto OBJECT_COUNT = 32;
-#else
-constexpr auto OBJECT_COUNT = 64;
-#endif
-
-constexpr auto MAX_LOD_LEVEL = 5;
-
-class VulkanExample : public VulkanExampleBase
-{
-public:
- bool fixedFrustum = false;
-
- // The model contains multiple versions of a single object with different levels of detail
- vkglTF::Model lodModel;
-
- // Per-instance data block
- struct InstanceData {
- glm::vec3 pos{ 0.0f };
- float scale{ 1.0f };
- };
-
- // Contains the instanced data
- vks::Buffer instanceBuffer;
- // Contains the indirect drawing commands
- vks::Buffer indirectCommandsBuffer;
- vks::Buffer indirectDrawCountBuffer;
-
- // Indirect draw statistics (updated via compute)
- struct {
- uint32_t drawCount; // Total number of indirect draw counts to be issued
- uint32_t lodCount[MAX_LOD_LEVEL + 1]; // Statistics for number of draws per LOD level (written by compute shader)
- } indirectStats;
-
- // Store the indirect draw commands containing index offsets and instance count per object
- std::vector indirectCommands;
-
- struct {
- glm::mat4 projection;
- glm::mat4 modelview;
- glm::vec4 cameraPos;
- glm::vec4 frustumPlanes[6];
- } uboScene;
-
- struct {
- vks::Buffer scene;
- } uniformData;
-
- VkPipelineLayout pipelineLayout{ VK_NULL_HANDLE };
- VkPipeline pipeline{ VK_NULL_HANDLE };
- VkDescriptorSetLayout descriptorSetLayout{ VK_NULL_HANDLE };
- VkDescriptorSet descriptorSet{ VK_NULL_HANDLE };
-
- // Resources for the compute part of the example
- struct {
- vks::Buffer lodLevelsBuffers; // Contains index start and counts for the different lod levels
- VkQueue queue; // Separate queue for compute commands (queue family may differ from the one used for graphics)
- VkCommandPool commandPool; // Use a separate command pool (queue family may differ from the one used for graphics)
- VkCommandBuffer commandBuffer; // Command buffer storing the dispatch commands and barriers
- VkFence fence; // Synchronization fence to avoid rewriting compute CB if still in use
- VkSemaphore semaphore; // Used as a wait semaphore for graphics submission
- VkDescriptorSetLayout descriptorSetLayout; // Compute shader binding layout
- VkDescriptorSet descriptorSet; // Compute shader bindings
- VkPipelineLayout pipelineLayout; // Layout of the compute pipeline
- VkPipeline pipeline; // Compute pipeline for updating particle positions
- } compute{};
-
- // View frustum for culling invisible objects
- vks::Frustum frustum;
-
- uint32_t objectCount = 0;
-
- VulkanExample() : VulkanExampleBase()
- {
- title = "Compute cull and lod";
- camera.type = Camera::CameraType::firstperson;
- camera.setPerspective(60.0f, (float)width / (float)height, 0.1f, 512.0f);
- camera.setTranslation(glm::vec3(0.5f, 0.0f, 0.0f));
- camera.movementSpeed = 5.0f;
- memset(&indirectStats, 0, sizeof(indirectStats));
- }
-
- ~VulkanExample()
- {
- if (device) {
- vkDestroyPipeline(device, pipeline, nullptr);
- vkDestroyPipelineLayout(device, pipelineLayout, nullptr);
- vkDestroyDescriptorSetLayout(device, descriptorSetLayout, nullptr);
- instanceBuffer.destroy();
- indirectCommandsBuffer.destroy();
- uniformData.scene.destroy();
- indirectDrawCountBuffer.destroy();
- compute.lodLevelsBuffers.destroy();
- vkDestroyPipelineLayout(device, compute.pipelineLayout, nullptr);
- vkDestroyDescriptorSetLayout(device, compute.descriptorSetLayout, nullptr);
- vkDestroyPipeline(device, compute.pipeline, nullptr);
- vkDestroyFence(device, compute.fence, nullptr);
- vkDestroyCommandPool(device, compute.commandPool, nullptr);
- vkDestroySemaphore(device, compute.semaphore, nullptr);
- }
- }
-
- virtual void getEnabledFeatures()
- {
- // Enable multi draw indirect if supported
- if (deviceFeatures.multiDrawIndirect) {
- enabledFeatures.multiDrawIndirect = VK_TRUE;
- }
- // This is required for for using firstInstance
- enabledFeatures.drawIndirectFirstInstance = VK_TRUE;
- }
-
- void buildCommandBuffers()
- {
- VkCommandBufferBeginInfo cmdBufInfo = vks::initializers::commandBufferBeginInfo();
-
- VkClearValue clearValues[2]{};
- clearValues[0].color = { { 0.18f, 0.27f, 0.5f, 0.0f } };
- clearValues[1].depthStencil = { 1.0f, 0 };
-
- VkRenderPassBeginInfo renderPassBeginInfo = vks::initializers::renderPassBeginInfo();
- renderPassBeginInfo.renderPass = renderPass;
- renderPassBeginInfo.renderArea.extent.width = width;
- renderPassBeginInfo.renderArea.extent.height = height;
- renderPassBeginInfo.clearValueCount = 2;
- renderPassBeginInfo.pClearValues = clearValues;
-
- for (int32_t i = 0; i < drawCmdBuffers.size(); ++i)
- {
- // Set target frame buffer
- renderPassBeginInfo.framebuffer = frameBuffers[i];
-
- VK_CHECK_RESULT(vkBeginCommandBuffer(drawCmdBuffers[i], &cmdBufInfo));
-
- // Acquire barrier
- if (vulkanDevice->queueFamilyIndices.graphics != vulkanDevice->queueFamilyIndices.compute)
- {
- VkBufferMemoryBarrier buffer_barrier =
- {
- VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,
- nullptr,
- 0,
- VK_ACCESS_INDIRECT_COMMAND_READ_BIT,
- vulkanDevice->queueFamilyIndices.compute,
- vulkanDevice->queueFamilyIndices.graphics,
- indirectCommandsBuffer.buffer,
- 0,
- indirectCommandsBuffer.descriptor.range
- };
-
- vkCmdPipelineBarrier(
- drawCmdBuffers[i],
- VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
- VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT,
- 0,
- 0, nullptr,
- 1, &buffer_barrier,
- 0, nullptr);
- }
-
- vkCmdBeginRenderPass(drawCmdBuffers[i], &renderPassBeginInfo, VK_SUBPASS_CONTENTS_INLINE);
-
- VkViewport viewport = vks::initializers::viewport((float)width, (float)height, 0.0f, 1.0f);
- vkCmdSetViewport(drawCmdBuffers[i], 0, 1, &viewport);
-
- VkRect2D scissor = vks::initializers::rect2D(width, height, 0, 0);
- vkCmdSetScissor(drawCmdBuffers[i], 0, 1, &scissor);
-
- VkDeviceSize offsets[1] = { 0 };
- vkCmdBindDescriptorSets(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipelineLayout, 0, 1, &descriptorSet, 0, NULL);
-
- // Mesh containing the LODs
- vkCmdBindPipeline(drawCmdBuffers[i], VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
- vkCmdBindVertexBuffers(drawCmdBuffers[i], 0, 1, &lodModel.vertices.buffer, offsets);
- vkCmdBindVertexBuffers(drawCmdBuffers[i], 1, 1, &instanceBuffer.buffer, offsets);
-
- vkCmdBindIndexBuffer(drawCmdBuffers[i], lodModel.indices.buffer, 0, VK_INDEX_TYPE_UINT32);
-
- if (vulkanDevice->features.multiDrawIndirect)
- {
- vkCmdDrawIndexedIndirect(drawCmdBuffers[i], indirectCommandsBuffer.buffer, 0, static_cast(indirectCommands.size()), sizeof(VkDrawIndexedIndirectCommand));
- }
- else
- {
- // If multi draw is not available, we must issue separate draw commands
- for (auto j = 0; j < indirectCommands.size(); j++)
- {
- vkCmdDrawIndexedIndirect(drawCmdBuffers[i], indirectCommandsBuffer.buffer, j * sizeof(VkDrawIndexedIndirectCommand), 1, sizeof(VkDrawIndexedIndirectCommand));
- }
- }
-
- drawUI(drawCmdBuffers[i]);
-
- vkCmdEndRenderPass(drawCmdBuffers[i]);
-
- // Release barrier
- if (vulkanDevice->queueFamilyIndices.graphics != vulkanDevice->queueFamilyIndices.compute)
- {
- VkBufferMemoryBarrier buffer_barrier =
- {
- VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,
- nullptr,
- VK_ACCESS_INDIRECT_COMMAND_READ_BIT,
- 0,
- vulkanDevice->queueFamilyIndices.graphics,
- vulkanDevice->queueFamilyIndices.compute,
- indirectCommandsBuffer.buffer,
- 0,
- indirectCommandsBuffer.descriptor.range
- };
-
- vkCmdPipelineBarrier(
- drawCmdBuffers[i],
- VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT,
- VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
- 0,
- 0, nullptr,
- 1, &buffer_barrier,
- 0, nullptr);
- }
-
- VK_CHECK_RESULT(vkEndCommandBuffer(drawCmdBuffers[i]));
- }
- }
-
- void loadAssets()
- {
- const uint32_t glTFLoadingFlags = vkglTF::FileLoadingFlags::PreTransformVertices | vkglTF::FileLoadingFlags::PreMultiplyVertexColors | vkglTF::FileLoadingFlags::FlipY;
- lodModel.loadFromFile(getAssetPath() + "models/suzanne_lods.gltf", vulkanDevice, queue, glTFLoadingFlags);
- }
-
- void buildComputeCommandBuffer()
- {
- VkCommandBufferBeginInfo cmdBufInfo = vks::initializers::commandBufferBeginInfo();
-
- VK_CHECK_RESULT(vkBeginCommandBuffer(compute.commandBuffer, &cmdBufInfo));
-
- // Acquire barrier
- // Add memory barrier to ensure that the indirect commands have been consumed before the compute shader updates them
- if (vulkanDevice->queueFamilyIndices.graphics != vulkanDevice->queueFamilyIndices.compute)
- {
- VkBufferMemoryBarrier buffer_barrier =
- {
- VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,
- nullptr,
- 0,
- VK_ACCESS_SHADER_WRITE_BIT,
- vulkanDevice->queueFamilyIndices.graphics,
- vulkanDevice->queueFamilyIndices.compute,
- indirectCommandsBuffer.buffer,
- 0,
- indirectCommandsBuffer.descriptor.range
- };
-
- vkCmdPipelineBarrier(
- compute.commandBuffer,
- VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,
- VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
- VK_FLAGS_NONE,
- 0, nullptr,
- 1, &buffer_barrier,
- 0, nullptr);
- }
-
- vkCmdBindPipeline(compute.commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, compute.pipeline);
- vkCmdBindDescriptorSets(compute.commandBuffer, VK_PIPELINE_BIND_POINT_COMPUTE, compute.pipelineLayout, 0, 1, &compute.descriptorSet, 0, 0);
-
- // Clear the buffer that the compute shader pass will write statistics and draw calls to
- vkCmdFillBuffer(compute.commandBuffer, indirectDrawCountBuffer.buffer, 0, indirectCommandsBuffer.descriptor.range, 0);
-
- // This barrier ensures that the fill command is finished before the compute shader can start writing to the buffer
- VkMemoryBarrier memoryBarrier = vks::initializers::memoryBarrier();
- memoryBarrier.srcAccessMask = VK_ACCESS_TRANSFER_WRITE_BIT;
- memoryBarrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT;
-
- vkCmdPipelineBarrier(
- compute.commandBuffer,
- VK_PIPELINE_STAGE_TRANSFER_BIT,
- VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
- VK_FLAGS_NONE,
- 1, &memoryBarrier,
- 0, nullptr,
- 0, nullptr);
-
- // Dispatch the compute job
- // The compute shader will do the frustum culling and adjust the indirect draw calls depending on object visibility.
- // It also determines the lod to use depending on distance to the viewer.
- vkCmdDispatch(compute.commandBuffer, objectCount / 16, 1, 1);
-
- // Release barrier
- // Add memory barrier to ensure that the compute shader has finished writing the indirect command buffer before it's consumed
- if (vulkanDevice->queueFamilyIndices.graphics != vulkanDevice->queueFamilyIndices.compute)
- {
- VkBufferMemoryBarrier buffer_barrier =
- {
- VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,
- nullptr,
- VK_ACCESS_SHADER_WRITE_BIT,
- 0,
- vulkanDevice->queueFamilyIndices.compute,
- vulkanDevice->queueFamilyIndices.graphics,
- indirectCommandsBuffer.buffer,
- 0,
- indirectCommandsBuffer.descriptor.range
- };
-
- vkCmdPipelineBarrier(
- compute.commandBuffer,
- VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
- VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
- VK_FLAGS_NONE,
- 0, nullptr,
- 1, &buffer_barrier,
- 0, nullptr);
- }
-
- // todo: barrier for indirect stats buffer?
-
- vkEndCommandBuffer(compute.commandBuffer);
- }
-
- void setupDescriptors()
- {
- // Pool
- std::vector poolSizes = {
- vks::initializers::descriptorPoolSize(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 2),
- vks::initializers::descriptorPoolSize(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER, 4)
- };
- VkDescriptorPoolCreateInfo descriptorPoolInfo = vks::initializers::descriptorPoolCreateInfo(poolSizes, 2);
- VK_CHECK_RESULT(vkCreateDescriptorPool(device, &descriptorPoolInfo, nullptr, &descriptorPool));
-
- // Layout
- std::vector setLayoutBindings = {
- // Binding 0: Vertex shader uniform buffer
- vks::initializers::descriptorSetLayoutBinding(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_SHADER_STAGE_VERTEX_BIT,0),
- };
- VkDescriptorSetLayoutCreateInfo descriptorLayout = vks::initializers::descriptorSetLayoutCreateInfo(setLayoutBindings);
- VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device, &descriptorLayout, nullptr, &descriptorSetLayout));
-
- // Set
- VkDescriptorSetAllocateInfo allocInfo = vks::initializers::descriptorSetAllocateInfo(descriptorPool, &descriptorSetLayout, 1);
- VK_CHECK_RESULT(vkAllocateDescriptorSets(device, &allocInfo, &descriptorSet));
- std::vector writeDescriptorSets = {
- // Binding 0: Vertex shader uniform buffer
- vks::initializers::writeDescriptorSet(descriptorSet, VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 0, &uniformData.scene.descriptor),
- };
- vkUpdateDescriptorSets(device, static_cast(writeDescriptorSets.size()), writeDescriptorSets.data(), 0, nullptr);
- }
-
- void preparePipelines()
- {
- // Layout
- VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vks::initializers::pipelineLayoutCreateInfo(&descriptorSetLayout, 1);
- VK_CHECK_RESULT(vkCreatePipelineLayout(device, &pipelineLayoutCreateInfo, nullptr, &pipelineLayout));
-
- // This example uses two different input states, one for the instanced part and one for non-instanced rendering
- VkPipelineVertexInputStateCreateInfo inputState = vks::initializers::pipelineVertexInputStateCreateInfo();
- std::vector bindingDescriptions;
- std::vector attributeDescriptions;
-
- // Vertex input bindings
- // The instancing pipeline uses a vertex input state with two bindings
- bindingDescriptions = {
- // Binding point 0: Mesh vertex layout description at per-vertex rate
- vks::initializers::vertexInputBindingDescription(0, sizeof(vkglTF::Vertex), VK_VERTEX_INPUT_RATE_VERTEX),
- // Binding point 1: Instanced data at per-instance rate
- vks::initializers::vertexInputBindingDescription(1, sizeof(InstanceData), VK_VERTEX_INPUT_RATE_INSTANCE)
- };
-
- // Vertex attribute bindings
- attributeDescriptions = {
- // Per-vertex attributes
- // These are advanced for each vertex fetched by the vertex shader
- vks::initializers::vertexInputAttributeDescription(0, 0, VK_FORMAT_R32G32B32_SFLOAT, offsetof(vkglTF::Vertex, pos)), // Location 0: Position
- vks::initializers::vertexInputAttributeDescription(0, 1, VK_FORMAT_R32G32B32_SFLOAT, offsetof(vkglTF::Vertex, normal)), // Location 1: Normal
- vks::initializers::vertexInputAttributeDescription(0, 2, VK_FORMAT_R32G32B32_SFLOAT, offsetof(vkglTF::Vertex, color)), // Location 2: Texture coordinates
- // Per-Instance attributes
- // These are fetched for each instance rendered
- vks::initializers::vertexInputAttributeDescription(1, 3, VK_FORMAT_R32G32B32_SFLOAT, offsetof(InstanceData, pos)), // Location 4: Position
- vks::initializers::vertexInputAttributeDescription(1, 4, VK_FORMAT_R32_SFLOAT, offsetof(InstanceData, scale)), // Location 5: Scale
- };
- inputState.pVertexBindingDescriptions = bindingDescriptions.data();
- inputState.pVertexAttributeDescriptions = attributeDescriptions.data();
- inputState.vertexBindingDescriptionCount = static_cast(bindingDescriptions.size());
- inputState.vertexAttributeDescriptionCount = static_cast(attributeDescriptions.size());
-
- // Indirect (and instanced) pipeline
- VkPipelineInputAssemblyStateCreateInfo inputAssemblyState = vks::initializers::pipelineInputAssemblyStateCreateInfo(VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, 0, VK_FALSE);
- VkPipelineRasterizationStateCreateInfo rasterizationState = vks::initializers::pipelineRasterizationStateCreateInfo(VK_POLYGON_MODE_FILL, VK_CULL_MODE_BACK_BIT, VK_FRONT_FACE_COUNTER_CLOCKWISE, 0);
- VkPipelineColorBlendAttachmentState blendAttachmentState = vks::initializers::pipelineColorBlendAttachmentState(0xf, VK_FALSE);
- VkPipelineColorBlendStateCreateInfo colorBlendState = vks::initializers::pipelineColorBlendStateCreateInfo(1, &blendAttachmentState);
- VkPipelineDepthStencilStateCreateInfo depthStencilState = vks::initializers::pipelineDepthStencilStateCreateInfo(VK_TRUE, VK_TRUE, VK_COMPARE_OP_LESS_OR_EQUAL);
- VkPipelineViewportStateCreateInfo viewportState = vks::initializers::pipelineViewportStateCreateInfo(1, 1, 0);
- VkPipelineMultisampleStateCreateInfo multisampleState = vks::initializers::pipelineMultisampleStateCreateInfo(VK_SAMPLE_COUNT_1_BIT, 0);
- std::vector dynamicStateEnables = {VK_DYNAMIC_STATE_VIEWPORT, VK_DYNAMIC_STATE_SCISSOR};
- VkPipelineDynamicStateCreateInfo dynamicState = vks::initializers::pipelineDynamicStateCreateInfo(dynamicStateEnables);
- VkGraphicsPipelineCreateInfo pipelineCreateInfo = vks::initializers::pipelineCreateInfo(pipelineLayout, renderPass);
- std::array shaderStages = {
- loadShader(getShadersPath() + "computecullandlod/indirectdraw.vert.spv", VK_SHADER_STAGE_VERTEX_BIT),
- loadShader(getShadersPath() + "computecullandlod/indirectdraw.frag.spv", VK_SHADER_STAGE_FRAGMENT_BIT)
- };
- pipelineCreateInfo.pVertexInputState = &inputState;
- pipelineCreateInfo.pInputAssemblyState = &inputAssemblyState;
- pipelineCreateInfo.pRasterizationState = &rasterizationState;
- pipelineCreateInfo.pColorBlendState = &colorBlendState;
- pipelineCreateInfo.pMultisampleState = &multisampleState;
- pipelineCreateInfo.pViewportState = &viewportState;
- pipelineCreateInfo.pDepthStencilState = &depthStencilState;
- pipelineCreateInfo.pDynamicState = &dynamicState;
- pipelineCreateInfo.stageCount = static_cast(shaderStages.size());
- pipelineCreateInfo.pStages = shaderStages.data();
- VK_CHECK_RESULT(vkCreateGraphicsPipelines(device, pipelineCache, 1, &pipelineCreateInfo, nullptr, &pipeline));
- }
-
- void prepareBuffers()
- {
- objectCount = OBJECT_COUNT * OBJECT_COUNT * OBJECT_COUNT;
-
- vks::Buffer stagingBuffer;
-
- std::vector instanceData(objectCount);
- indirectCommands.resize(objectCount);
-
- // Indirect draw commands
- for (uint32_t x = 0; x < OBJECT_COUNT; x++)
- {
- for (uint32_t y = 0; y < OBJECT_COUNT; y++)
- {
- for (uint32_t z = 0; z < OBJECT_COUNT; z++)
- {
- uint32_t index = x + y * OBJECT_COUNT + z * OBJECT_COUNT * OBJECT_COUNT;
- indirectCommands[index].instanceCount = 1;
- indirectCommands[index].firstInstance = index;
- // firstIndex and indexCount are written by the compute shader
- }
- }
- }
-
- indirectStats.drawCount = static_cast(indirectCommands.size());
-
- VK_CHECK_RESULT(vulkanDevice->createBuffer(
- VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
- VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
- &stagingBuffer,
- indirectCommands.size() * sizeof(VkDrawIndexedIndirectCommand),
- indirectCommands.data()));
-
- VK_CHECK_RESULT(vulkanDevice->createBuffer(
- VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT,
- VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
- &indirectCommandsBuffer,
- stagingBuffer.size));
-
- vulkanDevice->copyBuffer(&stagingBuffer, &indirectCommandsBuffer, queue);
-
- stagingBuffer.destroy();
-
- VK_CHECK_RESULT(vulkanDevice->createBuffer(
- VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT,
- VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
- &indirectDrawCountBuffer,
- sizeof(indirectStats)));
-
- // Map for host access
- VK_CHECK_RESULT(indirectDrawCountBuffer.map());
-
- // Instance data
- for (uint32_t x = 0; x < OBJECT_COUNT; x++)
- {
- for (uint32_t y = 0; y < OBJECT_COUNT; y++)
- {
- for (uint32_t z = 0; z < OBJECT_COUNT; z++)
- {
- uint32_t index = x + y * OBJECT_COUNT + z * OBJECT_COUNT * OBJECT_COUNT;
- instanceData[index].pos = glm::vec3((float)x, (float)y, (float)z) - glm::vec3((float)OBJECT_COUNT / 2.0f);
- instanceData[index].scale = 2.0f;
- }
- }
- }
-
- VK_CHECK_RESULT(vulkanDevice->createBuffer(
- VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
- VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
- &stagingBuffer,
- instanceData.size() * sizeof(InstanceData),
- instanceData.data()));
-
- VK_CHECK_RESULT(vulkanDevice->createBuffer(
- VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT,
- VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
- &instanceBuffer,
- stagingBuffer.size));
-
- // Copy from staging buffer to instance buffer
- VkCommandBuffer copyCmd = vulkanDevice->createCommandBuffer(VK_COMMAND_BUFFER_LEVEL_PRIMARY, true);
- VkBufferCopy copyRegion = {};
- copyRegion.size = stagingBuffer.size;
- vkCmdCopyBuffer(copyCmd, stagingBuffer.buffer, instanceBuffer.buffer, 1, ©Region);
- // Add an initial release barrier to the graphics queue,
- // so that when the compute command buffer executes for the first time
- // it doesn't complain about a lack of a corresponding "release" to its "acquire"
- if (vulkanDevice->queueFamilyIndices.graphics != vulkanDevice->queueFamilyIndices.compute)
- { VkBufferMemoryBarrier buffer_barrier =
- {
- VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER,
- nullptr,
- VK_ACCESS_INDIRECT_COMMAND_READ_BIT,
- 0,
- vulkanDevice->queueFamilyIndices.graphics,
- vulkanDevice->queueFamilyIndices.compute,
- indirectCommandsBuffer.buffer,
- 0,
- indirectCommandsBuffer.descriptor.range
- };
-
- vkCmdPipelineBarrier(
- copyCmd,
- VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT,
- VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT,
- 0,
- 0, nullptr,
- 1, &buffer_barrier,
- 0, nullptr);
- }
- vulkanDevice->flushCommandBuffer(copyCmd, queue, true);
-
- stagingBuffer.destroy();
-
- // Shader storage buffer containing index offsets and counts for the LODs
- struct LOD
- {
- uint32_t firstIndex;
- uint32_t indexCount;
- float distance;
- float _pad0;
- };
- std::vector LODLevels;
- uint32_t n = 0;
- for (auto node : lodModel.nodes)
- {
- LOD lod{};
- lod.firstIndex = node->mesh->primitives[0]->firstIndex; // First index for this LOD
- lod.indexCount = node->mesh->primitives[0]->indexCount; // Index count for this LOD
- lod.distance = 5.0f + n * 5.0f; // Starting distance (to viewer) for this LOD
- n++;
- LODLevels.push_back(lod);
- }
-
- VK_CHECK_RESULT(vulkanDevice->createBuffer(
- VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
- VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
- &stagingBuffer,
- LODLevels.size() * sizeof(LOD),
- LODLevels.data()));
-
- VK_CHECK_RESULT(vulkanDevice->createBuffer(
- VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT,
- VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT,
- &compute.lodLevelsBuffers,
- stagingBuffer.size));
-
- vulkanDevice->copyBuffer(&stagingBuffer, &compute.lodLevelsBuffers, queue);
-
- stagingBuffer.destroy();
-
- // Scene uniform buffer
- VK_CHECK_RESULT(vulkanDevice->createBuffer(
- VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT,
- VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
- &uniformData.scene,
- sizeof(uboScene)));
-
- VK_CHECK_RESULT(uniformData.scene.map());
-
- updateUniformBuffer();
- }
-
- void prepareCompute()
- {
- // Get a compute capable device queue
- vkGetDeviceQueue(device, vulkanDevice->queueFamilyIndices.compute, 0, &compute.queue);
-
- // Create compute pipeline
- // Compute pipelines are created separate from graphics pipelines even if they use the same queue (family index)
-
- std::vector setLayoutBindings = {
- // Binding 0: Instance input data buffer
- vks::initializers::descriptorSetLayoutBinding(
- VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
- VK_SHADER_STAGE_COMPUTE_BIT,
- 0),
- // Binding 1: Indirect draw command output buffer (input)
- vks::initializers::descriptorSetLayoutBinding(
- VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
- VK_SHADER_STAGE_COMPUTE_BIT,
- 1),
- // Binding 2: Uniform buffer with global matrices (input)
- vks::initializers::descriptorSetLayoutBinding(
- VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
- VK_SHADER_STAGE_COMPUTE_BIT,
- 2),
- // Binding 3: Indirect draw stats (output)
- vks::initializers::descriptorSetLayoutBinding(
- VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
- VK_SHADER_STAGE_COMPUTE_BIT,
- 3),
- // Binding 4: LOD info (input)
- vks::initializers::descriptorSetLayoutBinding(
- VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
- VK_SHADER_STAGE_COMPUTE_BIT,
- 4),
- };
-
- VkDescriptorSetLayoutCreateInfo descriptorLayout =
- vks::initializers::descriptorSetLayoutCreateInfo(
- setLayoutBindings.data(),
- static_cast(setLayoutBindings.size()));
-
- VK_CHECK_RESULT(vkCreateDescriptorSetLayout(device, &descriptorLayout, nullptr, &compute.descriptorSetLayout));
-
- VkPipelineLayoutCreateInfo pipelineLayoutCreateInfo = vks::initializers::pipelineLayoutCreateInfo(&compute.descriptorSetLayout, 1);
- VK_CHECK_RESULT(vkCreatePipelineLayout(device, &pipelineLayoutCreateInfo, nullptr, &compute.pipelineLayout));
-
- VkDescriptorSetAllocateInfo allocInfo = vks::initializers::descriptorSetAllocateInfo(descriptorPool, &compute.descriptorSetLayout, 1);
- VK_CHECK_RESULT(vkAllocateDescriptorSets(device, &allocInfo, &compute.descriptorSet));
-
- std::vector computeWriteDescriptorSets =
- {
- // Binding 0: Instance input data buffer
- vks::initializers::writeDescriptorSet(
- compute.descriptorSet,
- VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
- 0,
- &instanceBuffer.descriptor),
- // Binding 1: Indirect draw command output buffer
- vks::initializers::writeDescriptorSet(
- compute.descriptorSet,
- VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
- 1,
- &indirectCommandsBuffer.descriptor),
- // Binding 2: Uniform buffer with global matrices
- vks::initializers::writeDescriptorSet(
- compute.descriptorSet,
- VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER,
- 2,
- &uniformData.scene.descriptor),
- // Binding 3: Atomic counter (written in shader)
- vks::initializers::writeDescriptorSet(
- compute.descriptorSet,
- VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
- 3,
- &indirectDrawCountBuffer.descriptor),
- // Binding 4: LOD info
- vks::initializers::writeDescriptorSet(
- compute.descriptorSet,
- VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
- 4,
- &compute.lodLevelsBuffers.descriptor)
- };
-
- vkUpdateDescriptorSets(device, static_cast(computeWriteDescriptorSets.size()), computeWriteDescriptorSets.data(), 0, nullptr);
-
- // Create pipeline
- VkComputePipelineCreateInfo computePipelineCreateInfo = vks::initializers::computePipelineCreateInfo(compute.pipelineLayout, 0);
- computePipelineCreateInfo.stage = loadShader(getShadersPath() + "computecullandlod/cull.comp.spv", VK_SHADER_STAGE_COMPUTE_BIT);
-
- // Use specialization constants to pass max. level of detail (determined by no. of meshes)
- VkSpecializationMapEntry specializationEntry{};
- specializationEntry.constantID = 0;
- specializationEntry.offset = 0;
- specializationEntry.size = sizeof(uint32_t);
-
- uint32_t specializationData = static_cast(lodModel.nodes.size()) - 1;
-
- VkSpecializationInfo specializationInfo{};
- specializationInfo.mapEntryCount = 1;
- specializationInfo.pMapEntries = &specializationEntry;
- specializationInfo.dataSize = sizeof(specializationData);
- specializationInfo.pData = &specializationData;
-
- computePipelineCreateInfo.stage.pSpecializationInfo = &specializationInfo;
-
- VK_CHECK_RESULT(vkCreateComputePipelines(device, pipelineCache, 1, &computePipelineCreateInfo, nullptr, &compute.pipeline));
-
- // Separate command pool as queue family for compute may be different than graphics
- VkCommandPoolCreateInfo cmdPoolInfo = {};
- cmdPoolInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
- cmdPoolInfo.queueFamilyIndex = vulkanDevice->queueFamilyIndices.compute;
- cmdPoolInfo.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT;
- VK_CHECK_RESULT(vkCreateCommandPool(device, &cmdPoolInfo, nullptr, &compute.commandPool));
-
- // Create a command buffer for compute operations
- VkCommandBufferAllocateInfo cmdBufAllocateInfo =
- vks::initializers::commandBufferAllocateInfo(
- compute.commandPool,
- VK_COMMAND_BUFFER_LEVEL_PRIMARY,
- 1);
-
- VK_CHECK_RESULT(vkAllocateCommandBuffers(device, &cmdBufAllocateInfo, &compute.commandBuffer));
-
- // Fence for compute CB sync
- VkFenceCreateInfo fenceCreateInfo = vks::initializers::fenceCreateInfo(VK_FENCE_CREATE_SIGNALED_BIT);
- VK_CHECK_RESULT(vkCreateFence(device, &fenceCreateInfo, nullptr, &compute.fence));
-
- VkSemaphoreCreateInfo semaphoreCreateInfo = vks::initializers::semaphoreCreateInfo();
- VK_CHECK_RESULT(vkCreateSemaphore(device, &semaphoreCreateInfo, nullptr, &compute.semaphore));
-
- // Build a single command buffer containing the compute dispatch commands
- buildComputeCommandBuffer();
- }
-
- void updateUniformBuffer()
- {
- uboScene.projection = camera.matrices.perspective;
- uboScene.modelview = camera.matrices.view;
- if (!fixedFrustum)
- {
- uboScene.cameraPos = glm::vec4(camera.position, 1.0f) * -1.0f;
- frustum.update(uboScene.projection * uboScene.modelview);
- memcpy(uboScene.frustumPlanes, frustum.planes.data(), sizeof(glm::vec4) * 6);
- }
- memcpy(uniformData.scene.mapped, &uboScene, sizeof(uboScene));
- }
-
- void prepare()
- {
- VulkanExampleBase::prepare();
- loadAssets();
- prepareBuffers();
- setupDescriptors();
- preparePipelines();
- prepareCompute();
- buildCommandBuffers();
- prepared = true;
- }
-
- void draw()
- {
- VulkanExampleBase::prepareFrame();
-
- // Submit compute shader for frustum culling
-
- // Wait for fence to ensure that compute buffer writes have finished
- vkWaitForFences(device, 1, &compute.fence, VK_TRUE, UINT64_MAX);
- vkResetFences(device, 1, &compute.fence);
-
- VkSubmitInfo computeSubmitInfo = vks::initializers::submitInfo();
- computeSubmitInfo.commandBufferCount = 1;
- computeSubmitInfo.pCommandBuffers = &compute.commandBuffer;
- computeSubmitInfo.signalSemaphoreCount = 1;
- computeSubmitInfo.pSignalSemaphores = &compute.semaphore;
-
- VK_CHECK_RESULT(vkQueueSubmit(compute.queue, 1, &computeSubmitInfo, VK_NULL_HANDLE));
-
- // Submit graphics command buffer
-
- submitInfo.commandBufferCount = 1;
- submitInfo.pCommandBuffers = &drawCmdBuffers[currentBuffer];
-
- // Wait on present and compute semaphores
- std::array stageFlags = {
- VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
- VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT,
- };
- std::array waitSemaphores = {
- semaphores.presentComplete, // Wait for presentation to finished
- compute.semaphore // Wait for compute to finish
- };
-
- submitInfo.pWaitSemaphores = waitSemaphores.data();
- submitInfo.waitSemaphoreCount = static_cast(waitSemaphores.size());
- submitInfo.pWaitDstStageMask = stageFlags.data();
-
- // Submit to queue
- VK_CHECK_RESULT(vkQueueSubmit(queue, 1, &submitInfo, compute.fence));
-
- VulkanExampleBase::submitFrame();
-
- // Get draw count from compute
- memcpy(&indirectStats, indirectDrawCountBuffer.mapped, sizeof(indirectStats));
- }
-
- virtual void render()
- {
- if (!prepared)
- {
- return;
- }
- updateUniformBuffer();
- draw();
- }
-
- virtual void OnUpdateUIOverlay(vks::UIOverlay *overlay)
- {
- if (overlay->header("Settings")) {
- overlay->checkBox("Freeze frustum", &fixedFrustum);
- }
- if (overlay->header("Statistics")) {
- overlay->text("Visible objects: %d", indirectStats.drawCount);
- for (uint32_t i = 0; i < MAX_LOD_LEVEL + 1; i++) {
- overlay->text("LOD %d: %d", i, indirectStats.lodCount[i]);
- }
- }
- }
-};
-
-VULKAN_EXAMPLE_MAIN()
diff --git a/examples/computeheadless/computeheadless.cpp b/examples/computeheadless/computeheadless.cpp
deleted file mode 100644
index d0805037..00000000
--- a/examples/computeheadless/computeheadless.cpp
+++ /dev/null
@@ -1,636 +0,0 @@
-/*
-* Vulkan Example - Minimal headless compute example
-*
-* Copyright (C) 2017-2025 by Sascha Willems - www.saschawillems.de
-*
-* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
-*/
-
-#if defined(_WIN32)
-#pragma comment(linker, "/subsystem:console")
-#elif defined(VK_USE_PLATFORM_ANDROID_KHR)
-#include
-#include
-#include
-#include
-#include "VulkanAndroid.h"
-#endif
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#if (defined(VK_USE_PLATFORM_MACOS_MVK) || defined(VK_USE_PLATFORM_METAL_EXT))
-#define VK_ENABLE_BETA_EXTENSIONS
-#endif
-#include
-#include "VulkanTools.h"
-#include "CommandLineParser.hpp"
-
-#if defined(VK_USE_PLATFORM_ANDROID_KHR)
-android_app* androidapp;
-#endif
-
-#define DEBUG (!NDEBUG)
-
-#define BUFFER_ELEMENTS 32
-
-#if defined(VK_USE_PLATFORM_ANDROID_KHR)
-#define LOG(...) ((void)__android_log_print(ANDROID_LOG_INFO, "vulkanExample", __VA_ARGS__))
-#else
-#define LOG(...) printf(__VA_ARGS__)
-#endif
-
-static VKAPI_ATTR VkBool32 VKAPI_CALL debugMessageCallback(
- VkDebugReportFlagsEXT flags,
- VkDebugReportObjectTypeEXT objectType,
- uint64_t object,
- size_t location,
- int32_t messageCode,
- const char* pLayerPrefix,
- const char* pMessage,
- void* pUserData)
-{
- LOG("[VALIDATION]: %s - %s\n", pLayerPrefix, pMessage);
- return VK_FALSE;
-}
-
-CommandLineParser commandLineParser;
-
-class VulkanExample
-{
-public:
- VkInstance instance;
- VkPhysicalDevice physicalDevice;
- VkDevice device;
- uint32_t queueFamilyIndex;
- VkPipelineCache pipelineCache;
- VkQueue queue;
- VkCommandPool commandPool;
- VkCommandBuffer commandBuffer;
- VkFence fence;
- VkDescriptorPool descriptorPool;
- VkDescriptorSetLayout descriptorSetLayout;
- VkDescriptorSet descriptorSet;
- VkPipelineLayout pipelineLayout;
- VkPipeline pipeline;
- VkShaderModule shaderModule;
-
- VkDebugReportCallbackEXT debugReportCallback{};
-
- std::string shaderDir = "glsl";
-
- VkResult createBuffer(VkBufferUsageFlags usageFlags, VkMemoryPropertyFlags memoryPropertyFlags, VkBuffer *buffer, VkDeviceMemory *memory, VkDeviceSize size, void *data = nullptr)
- {
- // Create the buffer handle
- VkBufferCreateInfo bufferCreateInfo = vks::initializers::bufferCreateInfo(usageFlags, size);
- bufferCreateInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
- VK_CHECK_RESULT(vkCreateBuffer(device, &bufferCreateInfo, nullptr, buffer));
-
- // Create the memory backing up the buffer handle
- VkPhysicalDeviceMemoryProperties deviceMemoryProperties;
- vkGetPhysicalDeviceMemoryProperties(physicalDevice, &deviceMemoryProperties);
- VkMemoryRequirements memReqs;
- VkMemoryAllocateInfo memAlloc = vks::initializers::memoryAllocateInfo();
- vkGetBufferMemoryRequirements(device, *buffer, &memReqs);
- memAlloc.allocationSize = memReqs.size;
- // Find a memory type index that fits the properties of the buffer
- bool memTypeFound = false;
- for (uint32_t i = 0; i < deviceMemoryProperties.memoryTypeCount; i++) {
- if ((memReqs.memoryTypeBits & 1) == 1) {
- if ((deviceMemoryProperties.memoryTypes[i].propertyFlags & memoryPropertyFlags) == memoryPropertyFlags) {
- memAlloc.memoryTypeIndex = i;
- memTypeFound = true;
- break;
- }
- }
- memReqs.memoryTypeBits >>= 1;
- }
- assert(memTypeFound);
- VK_CHECK_RESULT(vkAllocateMemory(device, &memAlloc, nullptr, memory));
-
- if (data != nullptr) {
- void *mapped;
- VK_CHECK_RESULT(vkMapMemory(device, *memory, 0, size, 0, &mapped));
- memcpy(mapped, data, size);
- vkUnmapMemory(device, *memory);
- }
-
- VK_CHECK_RESULT(vkBindBufferMemory(device, *buffer, *memory, 0));
-
- return VK_SUCCESS;
- }
-
- VulkanExample()
- {
- LOG("Running headless compute example\n");
-
-#if defined(VK_USE_PLATFORM_ANDROID_KHR)
- LOG("loading vulkan lib");
- vks::android::loadVulkanLibrary();
-#endif
-
- if (commandLineParser.isSet("shaders")) {
- shaderDir = commandLineParser.getValueAsString("shaders", "glsl");
- }
-
- VkApplicationInfo appInfo = {};
- appInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
- appInfo.pApplicationName = "Vulkan headless example";
- appInfo.pEngineName = "VulkanExample";
- appInfo.apiVersion = VK_API_VERSION_1_0;
- // Shaders generated by Slang require a certain SPIR-V environment that can't be satisfied by Vulkan 1.0, so we need to expliclity up that to at least 1.1 and enable some required extensions
- if (shaderDir == "slang") {
- appInfo.apiVersion = VK_API_VERSION_1_1;
- }
-
- /*
- Vulkan instance creation (without surface extensions)
- */
- VkInstanceCreateInfo instanceCreateInfo = {};
- instanceCreateInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
- instanceCreateInfo.pApplicationInfo = &appInfo;
-
- uint32_t layerCount = 1;
- const char* validationLayers[] = { "VK_LAYER_KHRONOS_validation" };
-
- std::vector instanceExtensions = {};
-#if DEBUG
- // Check if layers are available
- uint32_t instanceLayerCount;
- vkEnumerateInstanceLayerProperties(&instanceLayerCount, nullptr);
- std::vector instanceLayers(instanceLayerCount);
- vkEnumerateInstanceLayerProperties(&instanceLayerCount, instanceLayers.data());
-
- bool layersAvailable = true;
- for (auto layerName : validationLayers) {
- bool layerAvailable = false;
- for (auto& instanceLayer : instanceLayers) {
- if (strcmp(instanceLayer.layerName, layerName) == 0) {
- layerAvailable = true;
- break;
- }
- }
- if (!layerAvailable) {
- layersAvailable = false;
- break;
- }
- }
-
- if (layersAvailable) {
- instanceExtensions.push_back(VK_EXT_DEBUG_REPORT_EXTENSION_NAME);
- instanceCreateInfo.ppEnabledLayerNames = validationLayers;
- instanceCreateInfo.enabledLayerCount = layerCount;
- }
-#endif
-#if (defined(VK_USE_PLATFORM_MACOS_MVK) || defined(VK_USE_PLATFORM_METAL_EXT))
- // SRS - When running on macOS with MoltenVK, enable VK_KHR_get_physical_device_properties2 (required by VK_KHR_portability_subset)
- instanceExtensions.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME);
-#if defined(VK_KHR_portability_enumeration)
- // SRS - When running on macOS with MoltenVK and VK_KHR_portability_enumeration is defined and supported by the instance, enable the extension and the flag
- uint32_t instanceExtCount = 0;
- vkEnumerateInstanceExtensionProperties(nullptr, &instanceExtCount, nullptr);
- if (instanceExtCount > 0)
- {
- std::vector extensions(instanceExtCount);
- if (vkEnumerateInstanceExtensionProperties(nullptr, &instanceExtCount, &extensions.front()) == VK_SUCCESS)
- {
- for (VkExtensionProperties extension : extensions)
- {
- if (strcmp(extension.extensionName, VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME) == 0)
- {
- instanceExtensions.push_back(VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME);
- instanceCreateInfo.flags = VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR;
- break;
- }
- }
- }
- }
-#endif
-#endif
- instanceCreateInfo.enabledExtensionCount = (uint32_t)instanceExtensions.size();
- instanceCreateInfo.ppEnabledExtensionNames = instanceExtensions.data();
- VK_CHECK_RESULT(vkCreateInstance(&instanceCreateInfo, nullptr, &instance));
-
-#if defined(VK_USE_PLATFORM_ANDROID_KHR)
- vks::android::loadVulkanFunctions(instance);
-#endif
-#if DEBUG
- if (layersAvailable) {
- VkDebugReportCallbackCreateInfoEXT debugReportCreateInfo = {};
- debugReportCreateInfo.sType = VK_STRUCTURE_TYPE_DEBUG_REPORT_CALLBACK_CREATE_INFO_EXT;
- debugReportCreateInfo.flags = VK_DEBUG_REPORT_ERROR_BIT_EXT | VK_DEBUG_REPORT_WARNING_BIT_EXT;
- debugReportCreateInfo.pfnCallback = (PFN_vkDebugReportCallbackEXT)debugMessageCallback;
-
- // We have to explicitly load this function.
- PFN_vkCreateDebugReportCallbackEXT vkCreateDebugReportCallbackEXT = reinterpret_cast(vkGetInstanceProcAddr(instance, "vkCreateDebugReportCallbackEXT"));
- assert(vkCreateDebugReportCallbackEXT);
- VK_CHECK_RESULT(vkCreateDebugReportCallbackEXT(instance, &debugReportCreateInfo, nullptr, &debugReportCallback));
- }
-#endif
-
- /*
- Vulkan device creation
- */
- // Physical device (always use first)
- uint32_t deviceCount = 0;
- VK_CHECK_RESULT(vkEnumeratePhysicalDevices(instance, &deviceCount, nullptr));
- std::vector physicalDevices(deviceCount);
- VK_CHECK_RESULT(vkEnumeratePhysicalDevices(instance, &deviceCount, physicalDevices.data()));
- physicalDevice = physicalDevices[0];
-
- VkPhysicalDeviceProperties deviceProperties;
- vkGetPhysicalDeviceProperties(physicalDevice, &deviceProperties);
- LOG("GPU: %s\n", deviceProperties.deviceName);
-
- // Request a single compute queue
- const float defaultQueuePriority(0.0f);
- VkDeviceQueueCreateInfo queueCreateInfo = {};
- uint32_t queueFamilyCount;
- vkGetPhysicalDeviceQueueFamilyProperties(physicalDevice, &queueFamilyCount, nullptr);
- std::vector queueFamilyProperties(queueFamilyCount);
- vkGetPhysicalDeviceQueueFamilyProperties(physicalDevice, &queueFamilyCount, queueFamilyProperties.data());
- for (uint32_t i = 0; i < static_cast(queueFamilyProperties.size()); i++) {
- if (queueFamilyProperties[i].queueFlags & VK_QUEUE_COMPUTE_BIT) {
- queueFamilyIndex = i;
- queueCreateInfo.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO;
- queueCreateInfo.queueFamilyIndex = i;
- queueCreateInfo.queueCount = 1;
- queueCreateInfo.pQueuePriorities = &defaultQueuePriority;
- break;
- }
- }
- // Create logical device
- VkDeviceCreateInfo deviceCreateInfo = {};
- deviceCreateInfo.sType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO;
- deviceCreateInfo.queueCreateInfoCount = 1;
- deviceCreateInfo.pQueueCreateInfos = &queueCreateInfo;
- std::vector deviceExtensions = {};
-
- // Shaders generated by Slang require a certain SPIR-V environment that can't be satisfied by Vulkan 1.0, so we need to expliclity up that to at least 1.1 and enable some required extensions
- if (shaderDir == "slang") {
- deviceExtensions.push_back(VK_KHR_SPIRV_1_4_EXTENSION_NAME);
- deviceExtensions.push_back(VK_KHR_SHADER_FLOAT_CONTROLS_EXTENSION_NAME);
- }
-
-#if (defined(VK_USE_PLATFORM_MACOS_MVK) || defined(VK_USE_PLATFORM_METAL_EXT)) && defined(VK_KHR_portability_subset)
- // When running on macOS with MoltenVK and VK_KHR_portability_subset is defined and supported by the device, enable the extension
- uint32_t deviceExtCount = 0;
- vkEnumerateDeviceExtensionProperties(physicalDevice, nullptr, &deviceExtCount, nullptr);
- if (deviceExtCount > 0)
- {
- std::vector extensions(deviceExtCount);
- if (vkEnumerateDeviceExtensionProperties(physicalDevice, nullptr, &deviceExtCount, &extensions.front()) == VK_SUCCESS)
- {
- for (VkExtensionProperties extension : extensions)
- {
- if (strcmp(extension.extensionName, VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME) == 0)
- {
- deviceExtensions.push_back(VK_KHR_PORTABILITY_SUBSET_EXTENSION_NAME);
- break;
- }
- }
- }
- }
-#endif
- deviceCreateInfo.enabledExtensionCount = (uint32_t)deviceExtensions.size();
- deviceCreateInfo.ppEnabledExtensionNames = deviceExtensions.data();
- VK_CHECK_RESULT(vkCreateDevice(physicalDevice, &deviceCreateInfo, nullptr, &device));
-
- // Get a compute queue
- vkGetDeviceQueue(device, queueFamilyIndex, 0, &queue);
-
- // Compute command pool
- VkCommandPoolCreateInfo cmdPoolInfo = {};
- cmdPoolInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO;
- cmdPoolInfo.queueFamilyIndex = queueFamilyIndex;
- cmdPoolInfo.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT;
- VK_CHECK_RESULT(vkCreateCommandPool(device, &cmdPoolInfo, nullptr, &commandPool));
-
- /*
- Prepare storage buffers
- */
- std::vector computeInput(BUFFER_ELEMENTS);
- std::vector