зеркало из https://github.com/AvaloniaUI/angle.git
Vulkan: Regression issue on AngryBird for read bandwidth
Use AllGraphicsShaderReadOnly as the image layout for graphics path. Bug: angleproject:3473 Change-Id: I1e653890e69f347b2aba4a0156a5d5b86109fd0e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1732617 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
This commit is contained in:
Родитель
4248e115bb
Коммит
d7500aa800
|
@ -2432,7 +2432,6 @@ angle::Result ContextVk::updateActiveTextures(const gl::Context *context,
|
|||
const gl::ActiveTextureMask &activeTextures = program->getActiveSamplersMask();
|
||||
const gl::ActiveTextureTypeArray &textureTypes = program->getActiveSamplerTypes();
|
||||
|
||||
const auto &uniforms = program->getState().getUniforms();
|
||||
for (size_t textureUnit : activeTextures)
|
||||
{
|
||||
gl::Texture *texture = textures[textureUnit];
|
||||
|
@ -2454,16 +2453,11 @@ angle::Result ContextVk::updateActiveTextures(const gl::Context *context,
|
|||
// staged updates in its staging buffer for unused texture mip levels or layers. Therefore
|
||||
// we can't verify it has no staged updates right here.
|
||||
|
||||
// Find out the image is used in which shader stage.
|
||||
vk::ImageLayout textureLayout = vk::ImageLayout::FragmentShaderReadOnly;
|
||||
vk::ImageLayout textureLayout = vk::ImageLayout::AllGraphicsShadersReadOnly;
|
||||
if (program->isCompute())
|
||||
{
|
||||
textureLayout = vk::ImageLayout::ComputeShaderReadOnly;
|
||||
}
|
||||
else if (uniforms[textureUnit].isActive(gl::ShaderType::Vertex))
|
||||
{
|
||||
textureLayout = vk::ImageLayout::AllGraphicsShadersReadOnly;
|
||||
}
|
||||
|
||||
// Ensure the image is in read-only layout
|
||||
if (image.isLayoutChangeNecessary(textureLayout))
|
||||
|
|
|
@ -774,7 +774,7 @@ angle::Result TextureVk::setStorageExternalMemory(const gl::Context *context,
|
|||
vk::CommandBuffer *commandBuffer = nullptr;
|
||||
ANGLE_TRY(mImage->recordCommands(contextVk, &commandBuffer));
|
||||
mImage->changeLayoutAndQueue(VK_IMAGE_ASPECT_COLOR_BIT,
|
||||
vk::ImageLayout::FragmentShaderReadOnly,
|
||||
vk::ImageLayout::AllGraphicsShadersReadOnly,
|
||||
rendererQueueFamilyIndex, commandBuffer);
|
||||
}
|
||||
|
||||
|
@ -806,7 +806,7 @@ angle::Result TextureVk::setEGLImageTarget(const gl::Context *context,
|
|||
vk::CommandBuffer *commandBuffer = nullptr;
|
||||
ANGLE_TRY(mImage->recordCommands(contextVk, &commandBuffer));
|
||||
mImage->changeLayoutAndQueue(VK_IMAGE_ASPECT_COLOR_BIT,
|
||||
vk::ImageLayout::FragmentShaderReadOnly,
|
||||
vk::ImageLayout::AllGraphicsShadersReadOnly,
|
||||
rendererQueueFamilyIndex, commandBuffer);
|
||||
}
|
||||
|
||||
|
|
|
@ -1063,11 +1063,11 @@ angle::Result UtilsVk::blitResolveImpl(ContextVk *contextVk,
|
|||
pipelineDesc.setScissor(gl_vk::GetRect(params.blitArea));
|
||||
|
||||
// Change source layout outside render pass
|
||||
if (src->isLayoutChangeNecessary(vk::ImageLayout::FragmentShaderReadOnly))
|
||||
if (src->isLayoutChangeNecessary(vk::ImageLayout::AllGraphicsShadersReadOnly))
|
||||
{
|
||||
vk::CommandBuffer *srcLayoutChange;
|
||||
ANGLE_TRY(src->recordCommands(contextVk, &srcLayoutChange));
|
||||
src->changeLayout(src->getAspectFlags(), vk::ImageLayout::FragmentShaderReadOnly,
|
||||
src->changeLayout(src->getAspectFlags(), vk::ImageLayout::AllGraphicsShadersReadOnly,
|
||||
srcLayoutChange);
|
||||
}
|
||||
|
||||
|
@ -1394,11 +1394,11 @@ angle::Result UtilsVk::copyImage(ContextVk *contextVk,
|
|||
pipelineDesc.setScissor(scissor);
|
||||
|
||||
// Change source layout outside render pass
|
||||
if (src->isLayoutChangeNecessary(vk::ImageLayout::FragmentShaderReadOnly))
|
||||
if (src->isLayoutChangeNecessary(vk::ImageLayout::AllGraphicsShadersReadOnly))
|
||||
{
|
||||
vk::CommandBuffer *srcLayoutChange;
|
||||
ANGLE_TRY(src->recordCommands(contextVk, &srcLayoutChange));
|
||||
src->changeLayout(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::FragmentShaderReadOnly,
|
||||
src->changeLayout(VK_IMAGE_ASPECT_COLOR_BIT, vk::ImageLayout::AllGraphicsShadersReadOnly,
|
||||
srcLayoutChange);
|
||||
}
|
||||
|
||||
|
|
|
@ -146,19 +146,6 @@ constexpr angle::PackedEnumMap<ImageLayout, ImageMemoryBarrierData> kImageMemory
|
|||
true,
|
||||
},
|
||||
},
|
||||
{
|
||||
ImageLayout::FragmentShaderReadOnly,
|
||||
{
|
||||
VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL,
|
||||
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
|
||||
VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
|
||||
// Transition to: all reads must happen after barrier.
|
||||
VK_ACCESS_SHADER_READ_BIT,
|
||||
// Transition from: RAR and WAR don't need memory barrier.
|
||||
0,
|
||||
false,
|
||||
},
|
||||
},
|
||||
{
|
||||
ImageLayout::ColorAttachment,
|
||||
{
|
||||
|
|
|
@ -627,14 +627,13 @@ enum class ImageLayout
|
|||
TransferDst = 3,
|
||||
ComputeShaderReadOnly = 4,
|
||||
ComputeShaderWrite = 5,
|
||||
FragmentShaderReadOnly = 6,
|
||||
AllGraphicsShadersReadOnly = 6,
|
||||
ColorAttachment = 7,
|
||||
DepthStencilAttachment = 8,
|
||||
AllGraphicsShadersReadOnly = 9,
|
||||
Present = 10,
|
||||
Present = 9,
|
||||
|
||||
InvalidEnum = 11,
|
||||
EnumCount = 11,
|
||||
InvalidEnum = 10,
|
||||
EnumCount = 10,
|
||||
};
|
||||
|
||||
class ImageHelper final : public CommandGraphResource
|
||||
|
|
Загрузка…
Ссылка в новой задаче