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