Skip to content

Commit

Permalink
vk: make rt renderer not fail validation at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
w23 committed May 1, 2024
1 parent 14ab066 commit fcd9c77
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
26 changes: 13 additions & 13 deletions ref/vk/vk_framectl.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static VkRenderPass createRenderPass( VkFormat depth_format, qboolean ray_tracin
};

BOUNDED_ARRAY(dependencies, VkSubpassDependency, 2);
if (ray_tracing) {
if (vk_core.rtx) {
const VkSubpassDependency color = {
.srcSubpass = VK_SUBPASS_EXTERNAL,
.dstSubpass = 0,
Expand All @@ -159,24 +159,24 @@ static VkRenderPass createRenderPass( VkFormat depth_format, qboolean ray_tracin
.dstSubpass = 0,
.srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
.dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
.srcAccessMask = 0, // VK_ACCESS_COLOR_ATTACHMENT_READ_BIT,
.srcAccessMask = 0,
.dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_READ_BIT | VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT,
.dependencyFlags = VK_DEPENDENCY_BY_REGION_BIT,
};
BOUNDED_ARRAY_APPEND(dependencies, color);

const VkSubpassDependency depth = {
.srcSubpass = VK_SUBPASS_EXTERNAL,
.dstSubpass = 0,
.srcStageMask = VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
.dstStageMask = VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
.srcAccessMask = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT,
.dstAccessMask = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT,
.dependencyFlags = 0,
};
BOUNDED_ARRAY_APPEND(dependencies, depth);
}

const VkSubpassDependency depth = {
.srcSubpass = VK_SUBPASS_EXTERNAL,
.dstSubpass = 0,
.srcStageMask = VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
.dstStageMask = VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT,
.srcAccessMask = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT,
.dstAccessMask = VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT | VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT,
.dependencyFlags = 0,
};
BOUNDED_ARRAY_APPEND(dependencies, depth);

const VkRenderPassCreateInfo rpci = {
.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO,
.attachmentCount = ARRAYSIZE(attachments),
Expand Down
3 changes: 2 additions & 1 deletion ref/vk/vk_ray_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ struct vk_combuf_s;
qboolean createOrUpdateAccelerationStructure(struct vk_combuf_s *combuf, const as_build_args_t *args);

#define MAX_SCRATCH_BUFFER (32*1024*1024)
#define MAX_ACCELS_BUFFER (128*1024*1024)
// FIXME compute this by lazily allocating #define MAX_ACCELS_BUFFER (128*1024*1024)
#define MAX_ACCELS_BUFFER (256*1024*1024)

typedef struct {
// Geometry metadata. Lifetime is similar to geometry lifetime itself.
Expand Down

0 comments on commit fcd9c77

Please sign in to comment.