Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Renderer
{ VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 1000 },
{ VK_DESCRIPTOR_TYPE_SAMPLER, 100 }
};
constexpr u32 maxDescriptorSets = 128;
constexpr u32 maxDescriptorSets = 256;

// [Temp descriptor sets] Per-frame transient pools, reset in FlipFrame once the slot's fence
// guarantees the GPU is done with the previous frame's transient sets
Expand Down Expand Up @@ -179,7 +179,7 @@ namespace Renderer
const std::string& bufferName = _bufferHandler->GetBufferName(bufferID);
std::string bindingName = (binding >= 0) ? GetBindingName(descriptorSet, static_cast<u32>(binding)) : "Unknown";

NC_LOG_ERROR(" ({}) Set {} Buffer {} '{}' at binding {} '{}' needs {} permission", BindingSlotNames[slot], bufferIndex, bufferName, binding, bindingName, permissionName);
NC_LOG_ERROR(" ({}) Buffer {} '{}' at binding {} '{}' needs {} permission", BindingSlotNames[slot], bufferIndex, bufferName, binding, bindingName, permissionName);
});

return didError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,26 @@ namespace Renderer
}

//bindInfos.insert(bindInfos.end(), bindReflection.dataBindings.begin(), bindReflection.dataBindings.end());
bindInfoPushConstants.insert(bindInfoPushConstants.end(), bindReflection.pushConstants.begin(), bindReflection.pushConstants.end());

// Merge push constants like the data bindings above: every reflected range gets
// the same blanket stage flags, and Vulkan forbids two ranges sharing a stage, so
// a block declared by both shaders must union into one range
for (const BindInfoPushConstant& pushConstant : bindReflection.pushConstants)
{
if (!bindInfoPushConstants.empty())
{
BindInfoPushConstant& existing = bindInfoPushConstants[0];

u32 end = glm::max(existing.offset + existing.size, pushConstant.offset + pushConstant.size);
existing.offset = glm::min(existing.offset, pushConstant.offset);
existing.size = end - existing.offset;
existing.stageFlags |= pushConstant.stageFlags;
}
else
{
bindInfoPushConstants.push_back(pushConstant);
}
}
}

// Build the used-set bitmask from reflection. DEBUG is included: if a shader actively uses the DEBUG set we want
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ namespace Renderer
deviceFeatures.features.depthClamp = VK_TRUE;
deviceFeatures.features.shaderStorageImageReadWithoutFormat = VK_TRUE;
deviceFeatures.features.shaderImageGatherExtended = VK_TRUE;
deviceFeatures.features.shaderClipDistance = VK_TRUE; // SVSM page draws clip to dirty rects via SV_ClipDistance
deviceFeatures.pNext = &device11Features;

CheckDeviceFeatureSupport(_physicalDevice, deviceFeatures);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Renderer
{
VkQueryPool queryPool;

static const u32 NUM_TOTAL_TIMESTAMPS = 200;
static const u32 NUM_TOTAL_TIMESTAMPS = 300;
u32 numTimestamps = 0;

std::vector<TimeQuery> timeQueries;
Expand Down
18 changes: 14 additions & 4 deletions Source/Renderer/Renderer/Renderers/Vulkan/RendererVK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -849,9 +849,16 @@ namespace Renderer
}

uvec2 extent = desc.extent;
if (extent == uvec2(0) && desc.renderTargets[0] != ImageMutableResource::Invalid())
if (extent == uvec2(0))
{
extent = _imageHandler->GetDimensions(desc.MutableResourceToImageID(desc.renderTargets[0]), 0);
if (desc.renderTargets[0] != ImageMutableResource::Invalid())
{
extent = _imageHandler->GetDimensions(desc.MutableResourceToImageID(desc.renderTargets[0]), 0);
}
else if (desc.depthStencil != DepthImageMutableResource::Invalid())
{
extent = _imageHandler->GetDimensions(desc.MutableResourceToDepthImageID(desc.depthStencil));
}
}

VkRenderingInfo renderInfo = {};
Expand Down Expand Up @@ -1733,12 +1740,15 @@ namespace Renderer
}
if ((from & BufferPassUsage::GRAPHICS) == BufferPassUsage::GRAPHICS)
{
srcStageMask |= VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT;
// DRAW_INDIRECT: the pass may have consumed the buffer as indirect draw args, a
// following write needs the execution dependency against that read (WAR)
srcStageMask |= VK_PIPELINE_STAGE_VERTEX_SHADER_BIT | VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT;
bufferBarrier.srcAccessMask |= VK_ACCESS_SHADER_WRITE_BIT;
}
if ((from & BufferPassUsage::COMPUTE) == BufferPassUsage::COMPUTE)
{
srcStageMask |= VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT;
// Same for indirect dispatch args
srcStageMask |= VK_PIPELINE_STAGE_COMPUTE_SHADER_BIT | VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT;
bufferBarrier.srcAccessMask |= VK_ACCESS_SHADER_WRITE_BIT;
}

Expand Down
Loading