cleaned up renderer
This commit is contained in:
parent
afe23851f0
commit
d661c88ee2
58 changed files with 3030 additions and 4722 deletions
|
|
@ -8,7 +8,7 @@ import Crafter.Math;
|
|||
|
||||
|
||||
int main() {
|
||||
VulkanDevice::CreateDevice();
|
||||
Device::CreateDevice();
|
||||
WindowVulkan window(1280, 720, "HelloVulkan");
|
||||
VkCommandBuffer cmd = window.StartInit();
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ int main() {
|
|||
std::array<Vector<float, 3, 3>, 3> verts {{{-150, -150, 100}, {0, 150, 100}, {150, -150, 100}}};
|
||||
std::array<std::uint32_t, 3> index {{2,1,0}};
|
||||
triangleMesh.Build(verts, index, cmd);
|
||||
RenderingElement3DVulkan renderer = {
|
||||
RenderingElement3D renderer = {
|
||||
.instance = {
|
||||
.instanceCustomIndex = 0,
|
||||
.mask = 0xFF,
|
||||
|
|
@ -92,9 +92,9 @@ int main() {
|
|||
};
|
||||
MatrixRowMajor<float, 4, 3, 1> transform = MatrixRowMajor<float, 4, 3, 1>::Identity();
|
||||
std::memcpy(renderer.instance.transform.matrix, transform.m, sizeof(transform.m));
|
||||
RenderingElement3DVulkan::tlases.resize(1);
|
||||
RenderingElement3DVulkan::elements.push_back(&renderer);
|
||||
RenderingElement3DVulkan::BuildTLAS(cmd, 0);
|
||||
RenderingElement3D::tlases.resize(1);
|
||||
RenderingElement3D::elements.push_back(&renderer);
|
||||
RenderingElement3D::BuildTLAS(cmd, 0);
|
||||
|
||||
VkDescriptorImageInfo imageInfo = {
|
||||
.imageView = window.imageViews[0],
|
||||
|
|
@ -104,7 +104,7 @@ int main() {
|
|||
VkWriteDescriptorSetAccelerationStructureKHR writeDescriptorSetAccelerationStructure {
|
||||
.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_ACCELERATION_STRUCTURE_KHR,
|
||||
.accelerationStructureCount = 1,
|
||||
.pAccelerationStructures = &RenderingElement3DVulkan::tlases[0].accelerationStructure
|
||||
.pAccelerationStructures = &RenderingElement3D::tlases[0].accelerationStructure
|
||||
};
|
||||
|
||||
VkWriteDescriptorSet write[2] = {
|
||||
|
|
@ -127,7 +127,7 @@ int main() {
|
|||
.pImageInfo = &imageInfo
|
||||
}
|
||||
};
|
||||
vkUpdateDescriptorSets(VulkanDevice::device, 2, write, 0, nullptr);
|
||||
vkUpdateDescriptorSets(Device::device, 2, write, 0, nullptr);
|
||||
|
||||
window.SetPipelineRT(pipeline);
|
||||
window.descriptorsRt = pool.sets;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue