Skip to content

Commit

Permalink
Add mingw ci
Browse files Browse the repository at this point in the history
  • Loading branch information
mattparks committed Jul 19, 2022
1 parent 4de6bc5 commit d62d892
Show file tree
Hide file tree
Showing 15 changed files with 92 additions and 43 deletions.
77 changes: 67 additions & 10 deletions .github/workflows/ci_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ jobs:
with:
submodules: recursive
- uses: lukka/get-cmake@v3.19.0
- name: Download OpenAL
run: |
Invoke-WebRequest -Uri "https://openal-soft.org/openal-binaries/openal-soft-1.21.0-bin.zip" -OutFile openal-soft.zip
Expand-Archive -Path openal-soft.zip -DestinationPath C:\\
- name: Download Vulkan
run: |
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/1.2.154.1/windows/VulkanSDK-1.2.154.1-Installer.exe" -OutFile VulkanSDK.exe
$installer = Start-Process -FilePath VulkanSDK.exe -Wait -PassThru -ArgumentList @("/S");
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/1.3.216.0/windows/VulkanSDK-1.3.216.0-Installer.exe" -OutFile vulkan-sdk.exe
$installer = Start-Process -FilePath vulkan-sdk.exe -Wait -PassThru -ArgumentList @("/S");
$installer.WaitForExit();
- name: Download OpenAL
run: |
Invoke-WebRequest -Uri "https://openal-soft.org/openal-binaries/openal-soft-1.22.2-bin.zip" -OutFile openal-soft.zip
Expand-Archive -Path openal-soft.zip -DestinationPath C:\\
- name: Build
env:
VULKAN_SDK: "C:\\VulkanSDK\\1.2.154.1"
OPENALDIR: "C:\\openal-soft-1.21.0-bin"
VULKAN_SDK: "C:\\VulkanSDK\\1.3.216.0"
OPENALDIR: "C:\\openal-soft-1.22.0-bin"
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cmake --version
ninja --version
cmake -B Build -GNinja -DACID_LINK_RESOURCES=0 -DACID_INSTALL_RESOURCES=0 -DACID_INSTALL_EXAMPLES=0 -DCMAKE_BUILD_TYPE=Release
Expand All @@ -47,7 +47,7 @@ jobs:
- name: Run Tests
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd Build
ctest
- name: Install
Expand All @@ -63,6 +63,63 @@ jobs:
name: Windows-MSVC.zip
path: ./Windows-MSVC.zip

windows_mingw:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: msys2/setup-msys2@v2
with:
update: true
install: >-
mingw-w64-x86_64-cmake
mingw-w64-x86_64-ninja
mingw-w64-x86_64-msmpi
- name: Put MSYS2_MinGW64 on PATH
# there is not yet an environment variable for this path from msys2/setup-msys2
run: echo "${{ runner.temp }}/msys64/mingw64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Download Vulkan
run: |
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/1.3.216.0/windows/VulkanSDK-1.3.216.0-Installer.exe" -OutFile vulkan-sdk.exe
$installer = Start-Process -FilePath vulkan-sdk.exe -Wait -PassThru -ArgumentList @("/S");
$installer.WaitForExit();
- name: Download OpenAL
run: |
Invoke-WebRequest -Uri "https://openal-soft.org/openal-binaries/openal-soft-1.22.2-bin.zip" -OutFile openal-soft.zip
Expand-Archive -Path openal-soft.zip -DestinationPath C:\\
- name: Build
env:
VULKAN_SDK: "C:\\VulkanSDK\\1.3.216.0"
OPENALDIR: "C:\\openal-soft-1.22.0-bin"
shell: cmd
run: |
cmake --version
ninja --version
cmake -B Build -GNinja -DACID_LINK_RESOURCES=0 -DACID_INSTALL_RESOURCES=0 -DACID_INSTALL_EXAMPLES=0 -DCMAKE_BUILD_TYPE=Release
cmake --build Build
- name: Copy OpenAL32.dll
shell: cmd
run: |
cp .github\workflows\openal\OpenAL32.dll Build\bin\OpenAL32.dll
- name: Run Tests
shell: cmd
run: |
cd Build
ctest
- name: Install
run: |
cmake --install Build --prefix Install --strip
- name: Pack Zip
working-directory: Install
run: |
cmake -E tar "cvf" "../Windows-MinGW.zip" --format=zip .
- name: Upload zip
uses: actions/upload-artifact@v3
with:
name: Windows-MinGW.zip
path: ./Windows-MinGW.zip

linux_clang:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 4 additions & 0 deletions Engine/Graphics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,12 @@ set(_component_generated_headers
${CMAKE_CURRENT_BINARY_DIR}/include/${_component_name}Export.hpp
)
set(_component_third_party_headers
${THIRD_PARTY_SOURCE_DIR}/stb/stb_image.h
${THIRD_PARTY_SOURCE_DIR}/tinygltf/tiny_gltf.h
${THIRD_PARTY_SOURCE_DIR}/tinyobj/tiny_obj.h
)
set(_component_third_party_sources
${THIRD_PARTY_SOURCE_DIR}/stb/stb_image.c
${THIRD_PARTY_SOURCE_DIR}/tinygltf/tiny_gltf.cpp
${THIRD_PARTY_SOURCE_DIR}/tinyobj/tiny_obj.cpp
)
Expand Down Expand Up @@ -192,9 +194,11 @@ target_include_directories(${_component_library}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<BUILD_INTERFACE:${THIRD_PARTY_SOURCE_DIR}/stb>
$<BUILD_INTERFACE:${THIRD_PARTY_SOURCE_DIR}/tinygltf>
$<BUILD_INTERFACE:${THIRD_PARTY_SOURCE_DIR}/tinyobj>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/${_component_name}>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/third_party/stb>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/third_party/tinygltf>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/third_party/tinyobj>
PRIVATE
Expand Down
1 change: 0 additions & 1 deletion Engine/Graphics/Graphics/Descriptors/Descriptor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class ACID_GRAPHICS_EXPORT WriteDescriptorSet {

class ACID_GRAPHICS_EXPORT Descriptor {
public:
Descriptor() = default;
virtual ~Descriptor() = default;

virtual WriteDescriptorSet GetWriteDescriptor(uint32_t binding, VkDescriptorType descriptorType, const std::optional<OffsetSize> &offsetSize) const = 0;
Expand Down
5 changes: 1 addition & 4 deletions Engine/Graphics/Graphics/Pipelines/Pipeline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@ class ACID_GRAPHICS_EXPORT Pipeline {
*/
using Stage = std::pair<uint32_t, uint32_t>;

Pipeline() = default;
virtual ~Pipeline() = default;

void BindPipeline(const CommandBuffer &commandBuffer) const {
vkCmdBindPipeline(commandBuffer, GetPipelineBindPoint(), GetPipeline());
}
virtual void BindPipeline(const CommandBuffer &commandBuffer) const = 0;

virtual const Shader *GetShader() const = 0;
virtual bool IsPushDescriptors() const = 0;
Expand Down
4 changes: 4 additions & 0 deletions Engine/Graphics/Graphics/Pipelines/PipelineCompute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ void PipelineCompute::CmdRender(const CommandBuffer &commandBuffer, const Vector
vkCmdDispatch(commandBuffer, groupCountX, groupCountY, 1);
}

void PipelineCompute::BindPipeline(const CommandBuffer &commandBuffer) const {
vkCmdBindPipeline(commandBuffer, GetPipelineBindPoint(), GetPipeline());
}

void PipelineCompute::CreateShaderProgram() {
std::stringstream defineBlock;
for (const auto &[defineName, defineValue] : defines)
Expand Down
1 change: 1 addition & 0 deletions Engine/Graphics/Graphics/Pipelines/PipelineCompute.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class ACID_GRAPHICS_EXPORT PipelineCompute : public Pipeline {
~PipelineCompute();

void CmdRender(const CommandBuffer &commandBuffer, const Vector2ui &extent) const;
void BindPipeline(const CommandBuffer &commandBuffer) const override;

const std::filesystem::path &GetShaderStage() const { return shaderStage; }
const std::vector<Shader::Define> &GetDefines() const { return defines; }
Expand Down
4 changes: 4 additions & 0 deletions Engine/Graphics/Graphics/Pipelines/PipelineGraphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ PipelineGraphics::~PipelineGraphics() {
vkDestroyDescriptorSetLayout(*logicalDevice, descriptorSetLayout, nullptr);
}

void PipelineGraphics::BindPipeline(const CommandBuffer &commandBuffer) const {
vkCmdBindPipeline(commandBuffer, GetPipelineBindPoint(), GetPipeline());
}

const ImageDepth *PipelineGraphics::GetDepthStencil(const std::optional<uint32_t> &stage) const {
return Graphics::Get()->GetRenderStage(stage ? *stage : this->stage.first)->GetDepthStencil();
}
Expand Down
2 changes: 2 additions & 0 deletions Engine/Graphics/Graphics/Pipelines/PipelineGraphics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class ACID_GRAPHICS_EXPORT PipelineGraphics : public Pipeline {
VkCullModeFlags cullMode = VK_CULL_MODE_BACK_BIT, VkFrontFace frontFace = VK_FRONT_FACE_CLOCKWISE, bool pushDescriptors = false);
~PipelineGraphics();

void BindPipeline(const CommandBuffer &commandBuffer) const override;

/**
* Gets the depth stencil used in a stage.
* @param stage The stage to get values from, if not provided the pipelines stage will be used.
Expand Down
4 changes: 0 additions & 4 deletions Engine/Graphics/Graphics/Renderer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ namespace acid {
class ACID_GRAPHICS_EXPORT Renderer {
friend class Graphics;
public:
/**
* Creates a new renderer, fill {@link renderStages} in your subclass of this.
*/
Renderer() = default;
virtual ~Renderer() = default;

/**
Expand Down
2 changes: 0 additions & 2 deletions Engine/Network/Network/Tcp/TcpSocket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ class Packet;
*/
class ACID_NETWORK_EXPORT PendingPacket {
public:
PendingPacket() = default;

/// Data of packet size.
uint32_t size = 0;
/// Number of size bytes received so far.
Expand Down
2 changes: 0 additions & 2 deletions Engine/Scene/Maths/Frustum.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ namespace acid {
*/
class ACID_SCENE_EXPORT Frustum {
public:
Frustum() = default;

/**
* Updates a frustum from the view and projection matrix.
* @param view The view matrix.
Expand Down
2 changes: 0 additions & 2 deletions Engine/Scene/Scenes/Entity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ namespace acid {
*/
class ACID_SCENE_EXPORT Entity final : NonCopyable {
public:
Entity() = default;

void Update();

const std::string &GetName() const { return name; }
Expand Down
7 changes: 0 additions & 7 deletions Engine/Ui/Fonts/Text.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ class ACID_UI_EXPORT Text : public UiObject {
Left, Centre, Right, Fully
};

Text() = default;

void UpdateObject() override;

bool CmdRender(const CommandBuffer &commandBuffer, const PipelineGraphics &pipeline);
Expand Down Expand Up @@ -170,11 +168,6 @@ class ACID_UI_EXPORT Text : public UiObject {
*/
class Word {
public:
/**
* Creates a new text word.
*/
Word() = default;

/**
* Adds a glyph to the end of the current word and increases the screen-space width of the word.
* @param glyph The glyph to be added.
Expand Down
2 changes: 0 additions & 2 deletions Engine/Ui/Uis/Inputs/UiRadioInput.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ class ACID_UI_EXPORT UiRadioInput : public UiObject {

class ACID_UI_EXPORT UiRadioManager : public virtual rocket::trackable {
public:
UiRadioManager() = default;

const UiRadioInput::Type &GetMarkType() const { return type; }

void SetMarkType(const UiRadioInput::Type &type) {
Expand Down
18 changes: 9 additions & 9 deletions External/volk/volk.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct VolkDeviceTable;
*
* Returns VK_SUCCESS on success and VK_ERROR_INITIALIZATION_FAILED otherwise.
*/
VkResult volkInitialize(void);
ACID_CONTEXT_EXPORT VkResult volkInitialize(void);

/**
* Initialize library by providing a custom handler to load global symbols.
Expand All @@ -81,50 +81,50 @@ VkResult volkInitialize(void);
* The handler function pointer will be asked to load global Vulkan symbols which require no instance
* (such as vkCreateInstance, vkEnumerateInstance* and vkEnumerateInstanceVersion if available).
*/
void volkInitializeCustom(PFN_vkGetInstanceProcAddr handler);
ACID_CONTEXT_EXPORT void volkInitializeCustom(PFN_vkGetInstanceProcAddr handler);

/**
* Get Vulkan instance version supported by the Vulkan loader, or 0 if Vulkan isn't supported
*
* Returns 0 if volkInitialize wasn't called or failed.
*/
uint32_t volkGetInstanceVersion(void);
ACID_CONTEXT_EXPORT uint32_t volkGetInstanceVersion(void);

/**
* Load global function pointers using application-created VkInstance; call this function after creating the Vulkan instance.
*/
void volkLoadInstance(VkInstance instance);
ACID_CONTEXT_EXPORT void volkLoadInstance(VkInstance instance);

/**
* Load global function pointers using application-created VkInstance; call this function after creating the Vulkan instance.
* Skips loading device-based function pointers, requires usage of volkLoadDevice afterwards.
*/
void volkLoadInstanceOnly(VkInstance instance);
ACID_CONTEXT_EXPORT void volkLoadInstanceOnly(VkInstance instance);

/**
* Load global function pointers using application-created VkDevice; call this function after creating the Vulkan device.
*
* Note: this is not suitable for applications that want to use multiple VkDevice objects concurrently.
*/
void volkLoadDevice(VkDevice device);
ACID_CONTEXT_EXPORT void volkLoadDevice(VkDevice device);

/**
* Return last VkInstance for which global function pointers have been loaded via volkLoadInstance(),
* or VK_NULL_HANDLE if volkLoadInstance() has not been called.
*/
VkInstance volkGetLoadedInstance(void);
ACID_CONTEXT_EXPORT VkInstance volkGetLoadedInstance(void);

/**
* Return last VkDevice for which global function pointers have been loaded via volkLoadDevice(),
* or VK_NULL_HANDLE if volkLoadDevice() has not been called.
*/
VkDevice volkGetLoadedDevice(void);
ACID_CONTEXT_EXPORT VkDevice volkGetLoadedDevice(void);

/**
* Load function pointers using application-created VkDevice into a table.
* Application should use function pointers from that table instead of using global function pointers.
*/
void volkLoadDeviceTable(struct VolkDeviceTable* table, VkDevice device);
ACID_CONTEXT_EXPORT void volkLoadDeviceTable(struct VolkDeviceTable* table, VkDevice device);

/**
* Device-specific function pointer table
Expand Down

0 comments on commit d62d892

Please sign in to comment.