A load of stuff
This commit is contained in:
23
Dockerfile
Normal file
23
Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
FROM ubuntu:22.04
|
||||
|
||||
# Install dependencies
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
cmake \
|
||||
git \
|
||||
vulkan-tools \
|
||||
libvulkan-dev \
|
||||
vulkan-validationlayers \
|
||||
spirv-tools \
|
||||
libxxf86vm-dev \
|
||||
libxi-dev \
|
||||
libglfw3-dev \
|
||||
libglm-dev \
|
||||
wget \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install glslc
|
||||
RUN wget -O /tmp/glslc.deb https://storage.googleapis.com/shaderc/badges/build_link_linux_gcc_release.html && \
|
||||
apt-get update && apt-get install -y /tmp/glslc.deb || true
|
||||
|
||||
WORKDIR /workspace
|
||||
37
README.md
Normal file
37
README.md
Normal file
@@ -0,0 +1,37 @@
|
||||
# Most linux distros
|
||||
## To build the container
|
||||
`docker build -t vulkan-dev .`
|
||||
## To run the container
|
||||
```sh
|
||||
sudo docker run -it \
|
||||
--device /dev/dri \
|
||||
-e DISPLAY=$DISPLAY \
|
||||
-v /tmp/.X11-unix:/tmp/.X11-unix \
|
||||
-v "$(pwd)":/workspace \
|
||||
vulkan-dev
|
||||
```
|
||||
## To enable X11 access:
|
||||
`xhost +local:docker`
|
||||
|
||||
# Windows
|
||||
## To build the container (in powershell)
|
||||
`docker build -t vulkan-dev .`
|
||||
## To run it
|
||||
### Option one with WSLg (recommended)
|
||||
```sh
|
||||
docker run -it \
|
||||
-v "$(pwd)":/workspace \
|
||||
vulkan-dev
|
||||
```
|
||||
### Option two with VcXsrv
|
||||
Set display in powershell:
|
||||
`$env:DISPLAY="host.docker.internal:0.0"`
|
||||
Run container:
|
||||
```sh
|
||||
docker run -it `
|
||||
-e DISPLAY=host.docker.internal:0.0 `
|
||||
-v ${PWD}:/workspace `
|
||||
vulkan-dev
|
||||
```
|
||||
|
||||
Not working
|
||||
22
cve_model.hpp
Normal file
22
cve_model.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
#include "cve_device.hpp"
|
||||
|
||||
namespace cve {
|
||||
class CveModel {
|
||||
public:
|
||||
CveModel();
|
||||
~CveModel();
|
||||
|
||||
CveModel(const CveModel &) = delete;
|
||||
CveModel &operator=(const CveModel &) = delete;
|
||||
|
||||
void bind(VkCommandBuffer commandBuffer);
|
||||
void draw(VkCommandBuffer commandBuffer);
|
||||
private:
|
||||
CveDevice &cveDevice;
|
||||
VkBuffer vertexBuffer;
|
||||
VkDeviceMemory vertexBufferMemory;
|
||||
uint32_t vertexCount;
|
||||
};
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
#version 450
|
||||
|
||||
vec2 positions[3] = vec2[] (
|
||||
vec2(0.0, -0.5),
|
||||
vec2(0.5, 0.5),
|
||||
vec2(-0.5, 0.5)
|
||||
);
|
||||
layout(location = 0) in vec2 position;
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0);
|
||||
gl_Position = vec4(position, 0.0, 1.0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user