Commit a5da17cd by Shahbaz Youssefi Committed by Commit Bot

Vulkan: Remove vk:: inside namespace vk

Bug: angleproject:5404 Change-Id: I51df1ad69a65b17621a3cbe4e5d55621cc9ae6ec Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2562683Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent eabbfcdd
......@@ -149,9 +149,9 @@ VkCompareOp PackGLCompareFunc(GLenum compareFunc)
}
void UnpackAttachmentDesc(VkAttachmentDescription *desc,
const vk::Format &format,
const Format &format,
uint8_t samples,
const vk::PackedAttachmentOpsDesc &ops)
const PackedAttachmentOpsDesc &ops)
{
// We would only need this flag for duplicated attachments. Apply it conservatively.
desc->flags = VK_ATTACHMENT_DESCRIPTION_MAY_ALIAS_BIT;
......@@ -170,7 +170,7 @@ void UnpackAttachmentDesc(VkAttachmentDescription *desc,
}
void UnpackColorResolveAttachmentDesc(VkAttachmentDescription *desc,
const vk::Format &format,
const Format &format,
bool usedAsInputAttachment,
bool isInvalidated)
{
......@@ -203,7 +203,7 @@ void UnpackColorResolveAttachmentDesc(VkAttachmentDescription *desc,
}
void UnpackDepthStencilResolveAttachmentDesc(VkAttachmentDescription *desc,
const vk::Format &format,
const Format &format,
bool usedAsDepthInputAttachment,
bool usedAsStencilInputAttachment,
bool isDepthInvalidated,
......@@ -238,7 +238,7 @@ void UnpackDepthStencilResolveAttachmentDesc(VkAttachmentDescription *desc,
desc->finalLayout = VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL;
}
void UnpackStencilState(const vk::PackedStencilOpState &packedState,
void UnpackStencilState(const PackedStencilOpState &packedState,
uint8_t stencilReference,
VkStencilOpState *stateOut)
{
......@@ -251,7 +251,7 @@ void UnpackStencilState(const vk::PackedStencilOpState &packedState,
stateOut->reference = stencilReference;
}
void UnpackBlendAttachmentState(const vk::PackedColorBlendAttachmentState &packedState,
void UnpackBlendAttachmentState(const PackedColorBlendAttachmentState &packedState,
VkPipelineColorBlendAttachmentState *stateOut)
{
stateOut->srcColorBlendFactor = static_cast<VkBlendFactor>(packedState.srcColorBlendFactor);
......@@ -746,7 +746,7 @@ angle::Result CreateRenderPass2(Context *context,
void UpdateRenderPassColorPerfCounters(const VkRenderPassCreateInfo &createInfo,
const VkSubpassDescription &subpass,
vk::RenderPassPerfCounters *countersOut)
RenderPassPerfCounters *countersOut)
{
// Color resolve counters.
if (subpass.pResolveAttachments == nullptr)
......@@ -770,7 +770,7 @@ void UpdateRenderPassColorPerfCounters(const VkRenderPassCreateInfo &createInfo,
void UpdateRenderPassDepthStencilPerfCounters(const VkRenderPassCreateInfo &createInfo,
size_t renderPassIndex,
vk::RenderPassPerfCounters *countersOut)
RenderPassPerfCounters *countersOut)
{
ASSERT(renderPassIndex != VK_ATTACHMENT_UNUSED);
......@@ -795,7 +795,7 @@ void UpdateRenderPassDepthStencilPerfCounters(const VkRenderPassCreateInfo &crea
void UpdateRenderPassDepthStencilResolvePerfCounters(
const VkRenderPassCreateInfo &createInfo,
const VkSubpassDescriptionDepthStencilResolve &depthStencilResolve,
vk::RenderPassPerfCounters *countersOut)
RenderPassPerfCounters *countersOut)
{
if (depthStencilResolve.pDepthStencilResolveAttachment == nullptr)
{
......@@ -834,11 +834,11 @@ void UpdateRenderPassPerfCounters(
const RenderPassDesc &desc,
const VkRenderPassCreateInfo &createInfo,
const VkSubpassDescriptionDepthStencilResolve &depthStencilResolve,
vk::RenderPassPerfCounters *countersOut)
RenderPassPerfCounters *countersOut)
{
// Accumulate depth/stencil attachment indices in all subpasses to avoid double-counting
// counters.
vk::FramebufferAttachmentMask depthStencilAttachmentIndices;
FramebufferAttachmentMask depthStencilAttachmentIndices;
for (uint32_t subpassIndex = 0; subpassIndex < createInfo.subpassCount; ++subpassIndex)
{
......@@ -880,7 +880,7 @@ void UpdateRenderPassPerfCounters(
angle::Result InitializeRenderPassFromDesc(ContextVk *contextVk,
const RenderPassDesc &desc,
const AttachmentOpsArray &ops,
vk::RenderPassHelper *renderPassHelper)
RenderPassHelper *renderPassHelper)
{
RendererVk *renderer = contextVk->getRenderer();
......@@ -930,7 +930,7 @@ angle::Result InitializeRenderPassFromDesc(ContextVk *contextVk,
angle::FormatID formatID = desc[colorIndexGL];
ASSERT(formatID != angle::FormatID::NONE);
const vk::Format &format = renderer->getFormat(formatID);
const Format &format = renderer->getFormat(formatID);
VkAttachmentReference colorRef;
colorRef.attachment = attachmentCount.get();
......@@ -953,7 +953,7 @@ angle::Result InitializeRenderPassFromDesc(ContextVk *contextVk,
angle::FormatID formatID = desc[depthStencilIndexGL];
ASSERT(formatID != angle::FormatID::NONE);
const vk::Format &format = renderer->getFormat(formatID);
const Format &format = renderer->getFormat(formatID);
depthStencilAttachmentRef.attachment = attachmentCount.get();
depthStencilAttachmentRef.layout = ConvertImageLayoutToVkImageLayout(
......@@ -980,7 +980,7 @@ angle::Result InitializeRenderPassFromDesc(ContextVk *contextVk,
ASSERT(desc.isColorAttachmentEnabled(colorIndexGL));
const vk::Format &format = renderer->getFormat(desc[colorIndexGL]);
const Format &format = renderer->getFormat(desc[colorIndexGL]);
VkAttachmentReference colorRef;
colorRef.attachment = attachmentCount.get();
......@@ -1010,7 +1010,7 @@ angle::Result InitializeRenderPassFromDesc(ContextVk *contextVk,
uint32_t depthStencilIndexGL = static_cast<uint32_t>(desc.depthStencilAttachmentIndex());
const vk::Format &format = renderer->getFormat(desc[depthStencilIndexGL]);
const Format &format = renderer->getFormat(desc[depthStencilIndexGL]);
const angle::Format &angleFormat = format.intendedFormat();
// Treat missing aspect as invalidated for the purpose of the resolve attachment.
......@@ -1155,8 +1155,8 @@ angle::Result InitializeRenderPassFromDesc(ContextVk *contextVk,
void GetRenderPassAndUpdateCounters(ContextVk *contextVk,
bool updatePerfCounters,
vk::RenderPassHelper *renderPassHelper,
vk::RenderPass **renderPassOut)
RenderPassHelper *renderPassHelper,
RenderPass **renderPassOut)
{
*renderPassOut = &renderPassHelper->getRenderPass();
if (updatePerfCounters)
......@@ -1181,8 +1181,8 @@ void GetRenderPassAndUpdateCounters(ContextVk *contextVk,
}
void InitializeSpecializationInfo(
const vk::SpecializationConstants &specConsts,
vk::SpecializationConstantMap<VkSpecializationMapEntry> *specializationEntriesOut,
const SpecializationConstants &specConsts,
SpecializationConstantMap<VkSpecializationMapEntry> *specializationEntriesOut,
VkSpecializationInfo *specializationInfoOut)
{
// Collect specialization constants.
......@@ -1194,12 +1194,12 @@ void InitializeSpecializationInfo(
{
case sh::vk::SpecializationConstantId::LineRasterEmulation:
(*specializationEntriesOut)[id].offset =
offsetof(vk::SpecializationConstants, lineRasterEmulation);
offsetof(SpecializationConstants, lineRasterEmulation);
(*specializationEntriesOut)[id].size = sizeof(specConsts.lineRasterEmulation);
break;
case sh::vk::SpecializationConstantId::SurfaceRotation:
(*specializationEntriesOut)[id].offset =
offsetof(vk::SpecializationConstants, surfaceRotation);
offsetof(SpecializationConstants, surfaceRotation);
(*specializationEntriesOut)[id].size = sizeof(specConsts.surfaceRotation);
break;
default:
......@@ -1602,7 +1602,7 @@ void GraphicsPipelineDesc::initDefaults(const ContextVk *contextVk)
angle::Result GraphicsPipelineDesc::initializePipeline(
ContextVk *contextVk,
const vk::PipelineCache &pipelineCacheVk,
const PipelineCache &pipelineCacheVk,
const RenderPass &compatibleRenderPass,
const PipelineLayout &pipelineLayout,
const gl::AttributesMask &activeAttribLocationsMask,
......@@ -1610,7 +1610,7 @@ angle::Result GraphicsPipelineDesc::initializePipeline(
const ShaderModule *vertexModule,
const ShaderModule *fragmentModule,
const ShaderModule *geometryModule,
const vk::SpecializationConstants specConsts,
const SpecializationConstants specConsts,
Pipeline *pipelineOut) const
{
angle::FixedVector<VkPipelineShaderStageCreateInfo, 3> shaderStages;
......@@ -1625,7 +1625,7 @@ angle::Result GraphicsPipelineDesc::initializePipeline(
VkSpecializationInfo specializationInfo = {};
VkGraphicsPipelineCreateInfo createInfo = {};
vk::SpecializationConstantMap<VkSpecializationMapEntry> specializationEntries;
SpecializationConstantMap<VkSpecializationMapEntry> specializationEntries;
InitializeSpecializationInfo(specConsts, &specializationEntries, &specializationInfo);
// Vertex shader is always expected to be present.
......@@ -1697,7 +1697,7 @@ angle::Result GraphicsPipelineDesc::initializePipeline(
// Get the corresponding VkFormat for the attrib's format.
angle::FormatID formatID = static_cast<angle::FormatID>(packedAttrib.format);
const vk::Format &format = contextVk->getRenderer()->getFormat(formatID);
const Format &format = contextVk->getRenderer()->getFormat(formatID);
const angle::Format &angleFormat = format.intendedFormat();
VkFormat vkFormat =
packedAttrib.compressed ? format.vkCompressedBufferFormat : format.vkBufferFormat;
......@@ -1978,7 +1978,7 @@ void GraphicsPipelineDesc::updateVertexInput(GraphicsPipelineTransitionBits *tra
bool compressed,
GLuint relativeOffset)
{
vk::PackedAttribDesc &packedAttrib = mVertexInputAttribs.attribs[attribIndex];
PackedAttribDesc &packedAttrib = mVertexInputAttribs.attribs[attribIndex];
SetBitField(packedAttrib.stride, stride);
SetBitField(packedAttrib.divisor, divisor);
......@@ -2566,7 +2566,7 @@ void AttachmentOpsArray::initWithLoadStore(PackedAttachmentIndex index,
ImageLayout finalLayout)
{
setLayouts(index, initialLayout, finalLayout);
setOps(index, VK_ATTACHMENT_LOAD_OP_LOAD, vk::RenderPassStoreOp::Store);
setOps(index, VK_ATTACHMENT_LOAD_OP_LOAD, RenderPassStoreOp::Store);
setStencilOps(index, VK_ATTACHMENT_LOAD_OP_LOAD, RenderPassStoreOp::Store);
}
......@@ -2646,7 +2646,7 @@ void DescriptorSetLayoutDesc::update(uint32_t bindingIndex,
VkDescriptorType type,
uint32_t count,
VkShaderStageFlags stages,
const vk::Sampler *immutableSampler)
const Sampler *immutableSampler)
{
ASSERT(static_cast<size_t>(type) < std::numeric_limits<uint16_t>::max());
ASSERT(count < std::numeric_limits<uint16_t>::max());
......@@ -3026,7 +3026,7 @@ void SamplerDesc::update(const angle::FeaturesVk &featuresVk,
mReserved[2] = 0;
}
angle::Result SamplerDesc::init(ContextVk *contextVk, vk::Sampler *sampler) const
angle::Result SamplerDesc::init(ContextVk *contextVk, Sampler *sampler) const
{
const gl::Extensions &extensions = contextVk->getExtensions();
......@@ -3062,7 +3062,7 @@ angle::Result SamplerDesc::init(ContextVk *contextVk, vk::Sampler *sampler) cons
filteringInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_FILTERING_PRECISION_GOOGLE;
filteringInfo.samplerFilteringPrecisionMode =
VK_SAMPLER_FILTERING_PRECISION_MODE_HIGH_GOOGLE;
vk::AddToPNextChain(&createInfo, &filteringInfo);
AddToPNextChain(&createInfo, &filteringInfo);
}
VkSamplerYcbcrConversionInfo yuvConversionInfo = {};
......@@ -3074,7 +3074,7 @@ angle::Result SamplerDesc::init(ContextVk *contextVk, vk::Sampler *sampler) cons
yuvConversionInfo.conversion =
contextVk->getRenderer()->getYuvConversionCache().getYuvConversionFromExternalFormat(
mExternalFormat);
vk::AddToPNextChain(&createInfo, &yuvConversionInfo);
AddToPNextChain(&createInfo, &yuvConversionInfo);
// Vulkan spec requires these settings:
createInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE;
......
......@@ -584,7 +584,7 @@ class GraphicsPipelineDesc final
}
angle::Result initializePipeline(ContextVk *contextVk,
const vk::PipelineCache &pipelineCacheVk,
const PipelineCache &pipelineCacheVk,
const RenderPass &compatibleRenderPass,
const PipelineLayout &pipelineLayout,
const gl::AttributesMask &activeAttribLocationsMask,
......@@ -592,7 +592,7 @@ class GraphicsPipelineDesc final
const ShaderModule *vertexModule,
const ShaderModule *fragmentModule,
const ShaderModule *geometryModule,
const vk::SpecializationConstants specConsts,
const SpecializationConstants specConsts,
Pipeline *pipelineOut) const;
// Vertex input state. For ES 3.1 this should be separated into binding and attribute.
......@@ -772,7 +772,7 @@ class DescriptorSetLayoutDesc final
VkDescriptorType type,
uint32_t count,
VkShaderStageFlags stages,
const vk::Sampler *immutableSampler);
const Sampler *immutableSampler);
void unpackBindings(DescriptorSetLayoutBindingVector *bindings,
std::vector<VkSampler> *immutableSamplers) const;
......@@ -870,7 +870,7 @@ class SamplerDesc final
bool stencilMode,
uint64_t externalFormat);
void reset();
angle::Result init(ContextVk *contextVk, vk::Sampler *sampler) const;
angle::Result init(ContextVk *contextVk, Sampler *sampler) const;
size_t hash() const;
bool operator==(const SamplerDesc &other) const;
......
......@@ -37,7 +37,7 @@ bool HasShaderImageAtomicsSupport(const RendererVk *rendererVk,
{
// Only VK_FORMAT_R32_SFLOAT doesn't have mandatory support for the STORAGE_IMAGE_ATOMIC and
// STORAGE_TEXEL_BUFFER_ATOMIC features.
const vk::Format &formatVk = rendererVk->getFormat(GL_R32F);
const Format &formatVk = rendererVk->getFormat(GL_R32F);
const bool hasImageAtomicSupport = rendererVk->hasImageFormatFeatureBits(
formatVk.vkImageFormat, VK_FORMAT_FEATURE_STORAGE_IMAGE_ATOMIC_BIT);
......@@ -60,11 +60,11 @@ bool FormatReinterpretationSupported(const std::vector<GLenum> &optionalSizedFor
const gl::TextureCaps &baseCaps = rendererVk->getNativeTextureCaps().get(glFormat);
if (baseCaps.texturable && baseCaps.filterable)
{
const vk::Format &vkFormat = rendererVk->getFormat(glFormat);
const Format &vkFormat = rendererVk->getFormat(glFormat);
VkFormat reinterpretedFormat = checkLinearColorspace
? vk::ConvertToLinear(vkFormat.vkImageFormat)
: vk::ConvertToSRGB(vkFormat.vkImageFormat);
? ConvertToLinear(vkFormat.vkImageFormat)
: ConvertToSRGB(vkFormat.vkImageFormat);
ASSERT(reinterpretedFormat != VK_FORMAT_UNDEFINED);
constexpr uint32_t kBitsSampleFilter =
......@@ -137,16 +137,15 @@ bool GetTextureSRGBOverrideSupport(const RendererVk *rendererVk,
std::vector<GLenum> optionalR8LinearFormats = {GL_R8};
std::vector<GLenum> optionalBPTCLinearFormats = {GL_COMPRESSED_RGBA_BPTC_UNORM_EXT};
if (!vk::FormatReinterpretationSupported(optionalLinearFormats, rendererVk,
kNonLinearColorspace))
if (!FormatReinterpretationSupported(optionalLinearFormats, rendererVk, kNonLinearColorspace))
{
return false;
}
if (supportedExtensions.textureCompressionS3TCsRGB == true)
{
if (!vk::FormatReinterpretationSupported(optionalS3TCLinearFormats, rendererVk,
kNonLinearColorspace))
if (!FormatReinterpretationSupported(optionalS3TCLinearFormats, rendererVk,
kNonLinearColorspace))
{
return false;
}
......@@ -154,8 +153,8 @@ bool GetTextureSRGBOverrideSupport(const RendererVk *rendererVk,
if (supportedExtensions.sRGBR8EXT == true)
{
if (!vk::FormatReinterpretationSupported(optionalR8LinearFormats, rendererVk,
kNonLinearColorspace))
if (!FormatReinterpretationSupported(optionalR8LinearFormats, rendererVk,
kNonLinearColorspace))
{
return false;
}
......@@ -165,8 +164,8 @@ bool GetTextureSRGBOverrideSupport(const RendererVk *rendererVk,
if (supportedExtensions.textureCompressionBPTC == true)
{
if (!vk::FormatReinterpretationSupported(optionalBPTCLinearFormats, rendererVk,
kNonLinearColorspace))
if (!FormatReinterpretationSupported(optionalBPTCLinearFormats, rendererVk,
kNonLinearColorspace))
{
return false;
}
......@@ -177,7 +176,7 @@ bool GetTextureSRGBOverrideSupport(const RendererVk *rendererVk,
bool HasTexelBufferSupport(const RendererVk *rendererVk, GLenum formatGL)
{
const vk::Format &formatVk = rendererVk->getFormat(formatGL);
const Format &formatVk = rendererVk->getFormat(formatGL);
return rendererVk->hasBufferFormatFeatureBits(
formatVk.vkBufferFormat,
......
......@@ -257,7 +257,7 @@ void FormatTable::initialize(RendererVk *renderer,
{
for (size_t formatIndex = 0; formatIndex < angle::kNumANGLEFormats; ++formatIndex)
{
vk::Format &format = mFormatData[formatIndex];
Format &format = mFormatData[formatIndex];
const auto formatID = static_cast<angle::FormatID>(formatIndex);
const angle::Format &angleFormat = angle::Format::Get(formatID);
......
......@@ -65,11 +65,11 @@ constexpr angle::PackedEnumMap<PipelineStage, VkPipelineStageFlagBits> kPipeline
{PipelineStage::BottomOfPipe, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT},
{PipelineStage::Host, VK_PIPELINE_STAGE_HOST_BIT}};
constexpr gl::ShaderMap<vk::PipelineStage> kPipelineStageShaderMap = {
{gl::ShaderType::Vertex, vk::PipelineStage::VertexShader},
{gl::ShaderType::Fragment, vk::PipelineStage::FragmentShader},
{gl::ShaderType::Geometry, vk::PipelineStage::GeometryShader},
{gl::ShaderType::Compute, vk::PipelineStage::ComputeShader},
constexpr gl::ShaderMap<PipelineStage> kPipelineStageShaderMap = {
{gl::ShaderType::Vertex, PipelineStage::VertexShader},
{gl::ShaderType::Fragment, PipelineStage::FragmentShader},
{gl::ShaderType::Geometry, PipelineStage::GeometryShader},
{gl::ShaderType::Compute, PipelineStage::ComputeShader},
};
constexpr size_t kDefaultPoolAllocatorPageSize = 16 * 1024;
......@@ -634,9 +634,9 @@ void ExtendRenderPassInvalidateArea(const gl::Rectangle &invalidateArea, gl::Rec
}
bool CanCopyWithTransferForCopyImage(RendererVk *renderer,
const vk::Format &srcFormat,
const Format &srcFormat,
VkImageTiling srcTilingMode,
const vk::Format &destFormat,
const Format &destFormat,
VkImageTiling destTilingMode)
{
// Neither source nor destination formats can be emulated for copy image through transfer,
......@@ -674,9 +674,9 @@ bool FormatHasNecessaryFeature(RendererVk *renderer,
}
bool CanCopyWithTransfer(RendererVk *renderer,
const vk::Format &srcFormat,
const Format &srcFormat,
VkImageTiling srcTilingMode,
const vk::Format &destFormat,
const Format &destFormat,
VkImageTiling destTilingMode)
{
// Checks that the formats in the copy transfer have the appropriate tiling and transfer bits
......@@ -943,7 +943,7 @@ bool CommandBufferHelper::onDepthStencilAccess(ResourceAccess access,
// If never invalidated or no longer invalidated, return early.
return false;
}
if (access == vk::ResourceAccess::Write)
if (access == ResourceAccess::Write)
{
// Drawing to this attachment is being enabled. Assume that drawing will immediately occur
// after this attachment is enabled, and that means that the attachment will no longer be
......@@ -1137,7 +1137,7 @@ void CommandBufferHelper::finalizeDepthStencilResolveImageLayout()
}
}
void CommandBufferHelper::onImageHelperRelease(const vk::ImageHelper *image)
void CommandBufferHelper::onImageHelperRelease(const ImageHelper *image)
{
ASSERT(mIsRenderPassCommandBuffer);
......@@ -1285,7 +1285,7 @@ void CommandBufferHelper::endTransformFeedback()
void CommandBufferHelper::invalidateRenderPassColorAttachment(PackedAttachmentIndex attachmentIndex)
{
ASSERT(mIsRenderPassCommandBuffer);
SetBitField(mAttachmentOps[attachmentIndex].storeOp, vk::RenderPassStoreOp::DontCare);
SetBitField(mAttachmentOps[attachmentIndex].storeOp, RenderPassStoreOp::DontCare);
mAttachmentOps[attachmentIndex].isInvalidated = true;
}
......@@ -1385,8 +1385,8 @@ angle::Result CommandBufferHelper::flushToPrimary(const angle::FeaturesVk &featu
return angle::Result::Continue;
}
void CommandBufferHelper::updateRenderPassForResolve(vk::Framebuffer *newFramebuffer,
const vk::RenderPassDesc &renderPassDesc)
void CommandBufferHelper::updateRenderPassForResolve(Framebuffer *newFramebuffer,
const RenderPassDesc &renderPassDesc)
{
ASSERT(newFramebuffer);
mFramebuffer.setHandle(newFramebuffer->getHandle());
......@@ -3259,11 +3259,11 @@ angle::Result BufferHelper::copyFromBuffer(ContextVk *contextVk,
uint32_t regionCount,
const VkBufferCopy *copyRegions)
{
vk::CommandBufferAccess access;
CommandBufferAccess access;
access.onBufferTransferRead(srcBuffer);
access.onBufferTransferWrite(this);
vk::CommandBuffer *commandBuffer;
CommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(access, &commandBuffer));
commandBuffer->copyBuffer(srcBuffer->getBuffer(), mBuffer, regionCount, copyRegions);
......@@ -4270,11 +4270,11 @@ void ImageHelper::barrierImpl(VkImageAspectFlags aspectMask,
mCurrentQueueFamilyIndex = newQueueFamilyIndex;
}
template void ImageHelper::barrierImpl<rx::vk::priv::SecondaryCommandBuffer>(
template void ImageHelper::barrierImpl<priv::SecondaryCommandBuffer>(
VkImageAspectFlags aspectMask,
ImageLayout newLayout,
uint32_t newQueueFamilyIndex,
rx::vk::priv::SecondaryCommandBuffer *commandBuffer);
priv::SecondaryCommandBuffer *commandBuffer);
bool ImageHelper::updateLayoutAndBarrier(VkImageAspectFlags aspectMask,
ImageLayout newLayout,
......@@ -4449,12 +4449,12 @@ void ImageHelper::Copy(ImageHelper *srcImage,
// static
angle::Result ImageHelper::CopyImageSubData(const gl::Context *context,
vk::ImageHelper *srcImage,
ImageHelper *srcImage,
GLint srcLevel,
GLint srcX,
GLint srcY,
GLint srcZ,
vk::ImageHelper *dstImage,
ImageHelper *dstImage,
GLint dstLevel,
GLint dstX,
GLint dstY,
......@@ -4463,12 +4463,12 @@ angle::Result ImageHelper::CopyImageSubData(const gl::Context *context,
GLsizei srcHeight,
GLsizei srcDepth)
{
ContextVk *contextVk = vk::GetImpl(context);
ContextVk *contextVk = GetImpl(context);
const vk::Format &sourceVkFormat = srcImage->getFormat();
VkImageTiling srcTilingMode = srcImage->getTilingMode();
const vk::Format &destVkFormat = dstImage->getFormat();
VkImageTiling destTilingMode = dstImage->getTilingMode();
const Format &sourceVkFormat = srcImage->getFormat();
VkImageTiling srcTilingMode = srcImage->getTilingMode();
const Format &destVkFormat = dstImage->getFormat();
VkImageTiling destTilingMode = dstImage->getTilingMode();
const gl::LevelIndex srcLevelGL = gl::LevelIndex(srcLevel);
const gl::LevelIndex dstLevelGL = gl::LevelIndex(dstLevel);
......@@ -4504,13 +4504,13 @@ angle::Result ImageHelper::CopyImageSubData(const gl::Context *context,
region.extent.height = srcHeight;
region.extent.depth = (isSrc3D || isDst3D) ? srcDepth : 1;
vk::CommandBufferAccess access;
CommandBufferAccess access;
access.onImageTransferRead(VK_IMAGE_ASPECT_COLOR_BIT, srcImage);
access.onImageTransferWrite(dstLevelGL, 1, region.dstSubresource.baseArrayLayer,
region.dstSubresource.layerCount, VK_IMAGE_ASPECT_COLOR_BIT,
dstImage);
vk::CommandBuffer *commandBuffer;
CommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(access, &commandBuffer));
ASSERT(srcImage->valid() && dstImage->valid());
......@@ -4553,11 +4553,11 @@ angle::Result ImageHelper::CopyImageSubData(const gl::Context *context,
angle::Result ImageHelper::generateMipmapsWithBlit(ContextVk *contextVk, LevelIndex maxLevel)
{
vk::CommandBufferAccess access;
CommandBufferAccess access;
access.onImageTransferWrite(mBaseLevel + 1, maxLevel.get(), 0, mLayerCount,
VK_IMAGE_ASPECT_COLOR_BIT, this);
vk::CommandBuffer *commandBuffer;
CommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(access, &commandBuffer));
// We are able to use blitImage since the image format we are using supports it.
......@@ -5395,7 +5395,7 @@ void ImageHelper::stageSelfForBaseLevel()
const gl::ImageIndex baseLevelIndex =
gl::ImageIndex::Make2DArrayRange(mBaseLevel.get(), 0, mLayerCount);
stageSubresourceUpdateFromImage(prevImage.release(), baseLevelIndex, gl::kOffsetZero,
getLevelExtents(vk::LevelIndex(0)), mImageType);
getLevelExtents(LevelIndex(0)), mImageType);
}
angle::Result ImageHelper::flushSingleSubresourceStagedUpdates(ContextVk *contextVk,
......@@ -5511,10 +5511,10 @@ angle::Result ImageHelper::flushStagedUpdates(ContextVk *contextVk,
// Start in TransferDst. Don't yet mark any subresource as having defined contents; that is
// done with fine granularity as updates are applied. This is achieved by specifying a layer
// that is outside the tracking range.
vk::CommandBufferAccess access;
CommandBufferAccess access;
access.onImageTransferWrite(mBaseLevel, 1, kMaxContentDefinedLayerCount, 0, aspectFlags, this);
vk::CommandBuffer *commandBuffer;
CommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(access, &commandBuffer));
for (gl::LevelIndex updateMipLevelGL = levelGLStart; updateMipLevelGL < levelGLEnd;
......@@ -5565,7 +5565,7 @@ angle::Result ImageHelper::flushStagedUpdates(ContextVk *contextVk,
// The updates were holding gl::LevelIndex values so that they would not need
// modification when the base level of the texture changes. Now that the update is
// about to take effect, we need to change miplevel to vk::LevelIndex.
// about to take effect, we need to change miplevel to LevelIndex.
if (update.updateSource == UpdateSource::Clear)
{
update.clear.levelIndex = updateMipLevelVk.get();
......@@ -5621,7 +5621,7 @@ angle::Result ImageHelper::flushStagedUpdates(ContextVk *contextVk,
BufferHelper *currentBuffer = bufferUpdate.bufferHelper;
ASSERT(currentBuffer && currentBuffer->valid());
vk::CommandBufferAccess bufferAccess;
CommandBufferAccess bufferAccess;
bufferAccess.onBufferTransferRead(currentBuffer);
ANGLE_TRY(
contextVk->getOutsideRenderPassCommandBuffer(bufferAccess, &commandBuffer));
......@@ -5633,7 +5633,7 @@ angle::Result ImageHelper::flushStagedUpdates(ContextVk *contextVk,
}
else
{
vk::CommandBufferAccess imageAccess;
CommandBufferAccess imageAccess;
imageAccess.onImageTransferRead(aspectFlags, update.image.image);
ANGLE_TRY(
contextVk->getOutsideRenderPassCommandBuffer(imageAccess, &commandBuffer));
......@@ -5917,11 +5917,11 @@ angle::Result ImageHelper::copyImageDataToBuffer(ContextVk *contextVk,
regions[1].imageSubresource.aspectMask = VK_IMAGE_ASPECT_STENCIL_BIT;
}
vk::CommandBufferAccess access;
CommandBufferAccess access;
access.onBufferTransferWrite(*bufferOut);
access.onImageTransferRead(aspectFlags, this);
vk::CommandBuffer *commandBuffer;
CommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(access, &commandBuffer));
commandBuffer->copyImageToBuffer(mImage, getCurrentLayout(), bufferHandle, 1, regions);
......@@ -6067,7 +6067,7 @@ angle::Result ImageHelper::readPixels(ContextVk *contextVk,
VkImageAspectFlags layoutChangeAspectFlags = src->getAspectFlags();
// Note that although we're reading from the image, we need to update the layout below.
vk::CommandBufferAccess access;
CommandBufferAccess access;
access.onImageTransferRead(layoutChangeAspectFlags, this);
if (isMultisampled)
{
......@@ -6075,7 +6075,7 @@ angle::Result ImageHelper::readPixels(ContextVk *contextVk,
&resolvedImage.get());
}
vk::CommandBuffer *commandBuffer;
CommandBuffer *commandBuffer;
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(access, &commandBuffer));
const angle::Format *readFormat = &mFormat->actualImageFormat();
......@@ -6120,7 +6120,7 @@ angle::Result ImageHelper::readPixels(ContextVk *contextVk,
resolve(&resolvedImage.get(), resolveRegion, commandBuffer);
vk::CommandBufferAccess readAccess;
CommandBufferAccess readAccess;
readAccess.onImageTransferRead(layoutChangeAspectFlags, &resolvedImage.get());
ANGLE_TRY(contextVk->getOutsideRenderPassCommandBuffer(readAccess, &commandBuffer));
......
......@@ -1014,7 +1014,7 @@ class CommandBufferHelper : angle::NonCopyable
return mRenderPassStarted;
}
void onImageHelperRelease(const vk::ImageHelper *image);
void onImageHelperRelease(const ImageHelper *image);
void beginRenderPass(const Framebuffer &framebuffer,
const gl::Rectangle &renderArea,
......@@ -1110,8 +1110,8 @@ class CommandBufferHelper : angle::NonCopyable
void onDepthAccess(ResourceAccess access);
void onStencilAccess(ResourceAccess access);
void updateRenderPassForResolve(vk::Framebuffer *newFramebuffer,
const vk::RenderPassDesc &renderPassDesc);
void updateRenderPassForResolve(Framebuffer *newFramebuffer,
const RenderPassDesc &renderPassDesc);
bool hasDepthStencilWriteOrClear() const
{
......@@ -1267,9 +1267,9 @@ bool FormatHasNecessaryFeature(RendererVk *renderer,
VkFormatFeatureFlags featureBits);
bool CanCopyWithTransfer(RendererVk *renderer,
const vk::Format &srcFormat,
const Format &srcFormat,
VkImageTiling srcTilingMode,
const vk::Format &destFormat,
const Format &destFormat,
VkImageTiling destTilingMode);
class ImageHelper final : public Resource, public angle::Subject
......@@ -1446,12 +1446,12 @@ class ImageHelper final : public Resource, public angle::Subject
CommandBuffer *commandBuffer);
static angle::Result CopyImageSubData(const gl::Context *context,
vk::ImageHelper *srcImage,
ImageHelper *srcImage,
GLint srcLevel,
GLint srcX,
GLint srcY,
GLint srcZ,
vk::ImageHelper *dstImage,
ImageHelper *dstImage,
GLint dstLevel,
GLint dstX,
GLint dstY,
......
......@@ -437,8 +437,8 @@ angle::Result StagingBuffer::init(Context *context, VkDeviceSize size, StagingUs
VkMemoryPropertyFlags requiredFlags =
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT;
RendererVk *renderer = context->getRenderer();
const vk::Allocator &allocator = renderer->getAllocator();
RendererVk *renderer = context->getRenderer();
const Allocator &allocator = renderer->getAllocator();
uint32_t memoryTypeIndex = 0;
ANGLE_VK_TRY(context,
......@@ -451,8 +451,8 @@ angle::Result StagingBuffer::init(Context *context, VkDeviceSize size, StagingUs
// invalid values ensures our testing doesn't assume zero-initialized memory.
if (renderer->getFeatures().allocateNonZeroMemory.enabled)
{
ANGLE_TRY(vk::InitMappableAllocation(context, allocator, &mAllocation, size,
kNonZeroInitValue, requiredFlags));
ANGLE_TRY(InitMappableAllocation(context, allocator, &mAllocation, size, kNonZeroInitValue,
requiredFlags));
}
return angle::Result::Continue;
......@@ -466,18 +466,18 @@ void StagingBuffer::release(ContextVk *contextVk)
void StagingBuffer::collectGarbage(RendererVk *renderer, Serial serial)
{
vk::GarbageList garbageList;
garbageList.emplace_back(vk::GetGarbage(&mBuffer));
garbageList.emplace_back(vk::GetGarbage(&mAllocation));
GarbageList garbageList;
garbageList.emplace_back(GetGarbage(&mBuffer));
garbageList.emplace_back(GetGarbage(&mAllocation));
vk::SharedResourceUse sharedUse;
SharedResourceUse sharedUse;
sharedUse.init();
sharedUse.updateSerialOneOff(serial);
renderer->collectGarbage(std::move(sharedUse), std::move(garbageList));
}
angle::Result InitMappableAllocation(Context *context,
const vk::Allocator &allocator,
const Allocator &allocator,
Allocation *allocation,
VkDeviceSize size,
int value,
......@@ -524,7 +524,7 @@ angle::Result InitMappableDeviceMemory(Context *context,
return angle::Result::Continue;
}
angle::Result AllocateBufferMemory(vk::Context *context,
angle::Result AllocateBufferMemory(Context *context,
VkMemoryPropertyFlags requestedMemoryPropertyFlags,
VkMemoryPropertyFlags *memoryPropertyFlagsOut,
const void *extraAllocationInfo,
......@@ -537,7 +537,7 @@ angle::Result AllocateBufferMemory(vk::Context *context,
deviceMemoryOut, sizeOut);
}
angle::Result AllocateImageMemory(vk::Context *context,
angle::Result AllocateImageMemory(Context *context,
VkMemoryPropertyFlags memoryPropertyFlags,
VkMemoryPropertyFlags *memoryPropertyFlagsOut,
const void *extraAllocationInfo,
......@@ -549,7 +549,7 @@ angle::Result AllocateImageMemory(vk::Context *context,
extraAllocationInfo, image, deviceMemoryOut, sizeOut);
}
angle::Result AllocateImageMemoryWithRequirements(vk::Context *context,
angle::Result AllocateImageMemoryWithRequirements(Context *context,
VkMemoryPropertyFlags memoryPropertyFlags,
const VkMemoryRequirements &memoryRequirements,
const void *extraAllocationInfo,
......@@ -562,7 +562,7 @@ angle::Result AllocateImageMemoryWithRequirements(vk::Context *context,
deviceMemoryOut);
}
angle::Result AllocateBufferMemoryWithRequirements(vk::Context *context,
angle::Result AllocateBufferMemoryWithRequirements(Context *context,
VkMemoryPropertyFlags memoryPropertyFlags,
const VkMemoryRequirements &memoryRequirements,
const void *extraAllocationInfo,
......
......@@ -372,14 +372,14 @@ class StagingBuffer final : angle::NonCopyable
};
angle::Result InitMappableAllocation(Context *context,
const vk::Allocator &allocator,
const Allocator &allocator,
Allocation *allocation,
VkDeviceSize size,
int value,
VkMemoryPropertyFlags memoryPropertyFlags);
angle::Result InitMappableDeviceMemory(Context *context,
vk::DeviceMemory *deviceMemory,
DeviceMemory *deviceMemory,
VkDeviceSize size,
int value,
VkMemoryPropertyFlags memoryPropertyFlags);
......@@ -407,7 +407,7 @@ angle::Result AllocateImageMemoryWithRequirements(Context *context,
Image *image,
DeviceMemory *deviceMemoryOut);
angle::Result AllocateBufferMemoryWithRequirements(vk::Context *context,
angle::Result AllocateBufferMemoryWithRequirements(Context *context,
VkMemoryPropertyFlags memoryPropertyFlags,
const VkMemoryRequirements &memoryRequirements,
const void *extraAllocationInfo,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment