1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-03-28 02:19:26 +01:00

[dxvk] Remove subresource parameter from initImage

We're always initializing the entire image anyway.
This commit is contained in:
Philip Rebohle 2025-03-23 16:59:46 +01:00
parent 86b6bd6cef
commit 519b8f8aa8
8 changed files with 9 additions and 21 deletions

View File

@ -316,7 +316,7 @@ namespace dxvk {
cStorage = std::move(storage)
] (DxvkContext* ctx) {
ctx->invalidateImage(cImage, Rc<DxvkResourceAllocation>(cStorage));
ctx->initImage(cImage, cImage->getAvailableSubresources(), VK_IMAGE_LAYOUT_PREINITIALIZED);
ctx->initImage(cImage, VK_IMAGE_LAYOUT_PREINITIALIZED);
});
pMappedResource->RowPitch = layout.RowPitch;

View File

@ -505,7 +505,7 @@ namespace dxvk {
cStorage = pResource->DiscardStorage()
] (DxvkContext* ctx) {
ctx->invalidateImage(cImage, Rc<DxvkResourceAllocation>(cStorage));
ctx->initImage(cImage, cImage->getAvailableSubresources(), VK_IMAGE_LAYOUT_PREINITIALIZED);
ctx->initImage(cImage, VK_IMAGE_LAYOUT_PREINITIALIZED);
});
ThrottleDiscard(layout.Size);

View File

@ -232,9 +232,7 @@ namespace dxvk {
EmitCs([
cImage = std::move(image)
] (DxvkContext* ctx) {
ctx->initImage(cImage,
cImage->getAvailableSubresources(),
VK_IMAGE_LAYOUT_UNDEFINED);
ctx->initImage(cImage, VK_IMAGE_LAYOUT_UNDEFINED);
});
}
@ -305,9 +303,7 @@ namespace dxvk {
EmitCs([
cImage = std::move(image)
] (DxvkContext* ctx) {
ctx->initImage(cImage,
cImage->getAvailableSubresources(),
VK_IMAGE_LAYOUT_PREINITIALIZED);
ctx->initImage(cImage, VK_IMAGE_LAYOUT_PREINITIALIZED);
});
m_transferCommands += 1;

View File

@ -584,10 +584,7 @@ namespace dxvk {
] (DxvkContext* ctx) {
for (size_t i = 0; i < cImages.size(); i++) {
ctx->setDebugName(cImages[i], str::format("Back buffer ", i).c_str());
ctx->initImage(cImages[i],
cImages[i]->getAvailableSubresources(),
VK_IMAGE_LAYOUT_UNDEFINED);
ctx->initImage(cImages[i], VK_IMAGE_LAYOUT_UNDEFINED);
}
});
}

View File

@ -101,9 +101,7 @@ namespace dxvk {
EmitCs([
cImage = std::move(image)
] (DxvkContext* ctx) {
ctx->initImage(cImage,
cImage->getAvailableSubresources(),
VK_IMAGE_LAYOUT_UNDEFINED);
ctx->initImage(cImage, VK_IMAGE_LAYOUT_UNDEFINED);
});
ThrottleAllocationLocked();

View File

@ -1053,9 +1053,7 @@ namespace dxvk {
cImages = std::move(images)
] (DxvkContext* ctx) {
for (size_t i = 0; i < cImages.size(); i++) {
ctx->initImage(cImages[i],
cImages[i]->getAvailableSubresources(),
VK_IMAGE_LAYOUT_UNDEFINED);
ctx->initImage(cImages[i], VK_IMAGE_LAYOUT_UNDEFINED);
}
});

View File

@ -1088,8 +1088,9 @@ namespace dxvk {
void DxvkContext::initImage(
const Rc<DxvkImage>& image,
const VkImageSubresourceRange& subresources,
VkImageLayout initialLayout) {
VkImageSubresourceRange subresources = image->getAvailableSubresources();
if (initialLayout == VK_IMAGE_LAYOUT_PREINITIALIZED) {
accessImage(DxvkCmdBuffer::InitBarriers,
*image, subresources, initialLayout,

View File

@ -934,12 +934,10 @@ namespace dxvk {
* it to black unless the initial layout is preinitialized.
* Only safe to call if the image is not in use by the GPU.
* \param [in] image The image to initialize
* \param [in] subresources Image subresources
* \param [in] initialLayout Initial image layout
*/
void initImage(
const Rc<DxvkImage>& image,
const VkImageSubresourceRange& subresources,
VkImageLayout initialLayout);
/**