VulkanRaytracingCycles 0.0.0
Cycles Render Engine With VulkanRaytracingShaderModules. ( Experiment , in progress)
incomplete.cpp
Go to the documentation of this file.
1#include "pch_mm.h"
2#include "types.hpp"
3#include "working_mm.h"
4#include "aeolus/incomplete.h"
5
6
8 id(-1),
9 refCnt(0),
10 buffer({ -1,0,0}),
11 align(0),
12 reqAlign(0),
13 size(0),
14 reqSize(0),
15 vacancy(),
16 type(""),
17 excl({}),
18 vkBuffer(VK_NULL_HANDLE),
19 mapped(nullptr)
20{};
21
23 size_t hash,
24 VkDeviceSize align,
25 LayoutType type
26) :
27 id(-1),
28 refCnt(0),
29 buffer({-1,0,hash}),
30 align(align),
31 reqAlign(0),
32 size(0),
33 reqSize(0),
34 vacancy(),
35 type(type),
36 excl({}),
37 vkBuffer(VK_NULL_HANDLE),
38 mapped(nullptr)
39{};
40
42{
43
44 if (&other == this)
45 return *this;
46
47 this->align = other.align;
48 this->buffer.hash = other.buffer.hash;
49 this->type = other.type;
50
51 return *this;
52};
53
54
55
56namespace brunch {
57
58 void createComputePipeline(VkPipeline& pipe, const char* shader, VkPipelineLayout draft, VkPipelineCache cache, VkSpecializationInfo* specializationInfo) {
59
60 VkComputePipelineCreateInfo computePipelineCreateInfo = {
61 .sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO,
62 .flags = 0,
63 .layout = draft,
64 };
65
66
67 VkPipelineShaderStageCreateInfo shaderStage = {};
68 shaderStage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
69 shaderStage.stage = VK_SHADER_STAGE_COMPUTE_BIT;
70 shaderStage.module = vka::shelve::loadShader((std::string(COMSHADER_PATH) + std::string(shader) + std::string(".comp.spv")).c_str(), $device);
71 shaderStage.pName = "main";
72 if (specializationInfo != nullptr)shaderStage.pSpecializationInfo = specializationInfo;
73 assert(shaderStage.module != VK_NULL_HANDLE);
74 computePipelineCreateInfo.stage = shaderStage;
75
76 VK_CHECK_RESULT(vkCreateComputePipelines($device, cache, 1, &computePipelineCreateInfo, nullptr, &pipe));
77 vkDestroyShaderModule($device, shaderStage.module, nullptr);
78
79 };
80
81}
82
83
84namespace arth {
85
86 std::string INPUT_String(arth::INPUT type) {
87
88#define CaseInputString(in) case in: return std::string(#in);
89 switch (type)
90 {
91 CaseInputString(arth::INPUT::vertexPRS)
92 CaseInputString(arth::INPUT::vertexPC)
93 CaseInputString(arth::INPUT::vertexPUN)
94 CaseInputString(arth::INPUT::vertexPV)
95 CaseInputString(arth::INPUT::vertexPNC)
96 CaseInputString(arth::INPUT::vertexPQS)
97 CaseInputString(arth::INPUT::vertexPQS4)
98 CaseInputString(arth::INPUT::vertexPN)
99 CaseInputString(arth::INPUT::vertexSprite)
100 default:
101 break;
102 };
103 return std::to_string(UINT(type)) + "Unknown";
104 };
105
106};
#define CaseInputString(in)
std::string INPUT_String(arth::INPUT type)
Definition: incomplete.cpp:86
void createComputePipeline(VkPipeline &pipe, const char *shader, VkPipelineLayout draft, VkPipelineCache cache, VkSpecializationInfo *specializationInfo)
Definition: incomplete.cpp:58
VkDeviceSize align
Definition: incomplete.h:123
Bache()
Definition: incomplete.cpp:7
Hache buffer
Definition: incomplete.h:121
std::string_view type
Definition: incomplete.h:131
Bache & operator=(const Bache &other)
Definition: incomplete.cpp:41
size_t hash
std::string_view LayoutType