当前位置: 首页>>代码示例>>C++>>正文


C++ VkResourceRecord::AddBindFrameRef方法代码示例

本文整理汇总了C++中VkResourceRecord::AddBindFrameRef方法的典型用法代码示例。如果您正苦于以下问题:C++ VkResourceRecord::AddBindFrameRef方法的具体用法?C++ VkResourceRecord::AddBindFrameRef怎么用?C++ VkResourceRecord::AddBindFrameRef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在VkResourceRecord的用法示例。


在下文中一共展示了VkResourceRecord::AddBindFrameRef方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: vkUpdateDescriptorSets


//.........这里部分代码省略.........
                // that was removed already
                bind.texelBufferView = VK_NULL_HANDLE;
                bind.bufferInfo.buffer = VK_NULL_HANDLE;
                bind.imageInfo.imageView = VK_NULL_HANDLE;
                bind.imageInfo.sampler = VK_NULL_HANDLE;

                if(pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER ||
                        pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER)
                {
                    bind.texelBufferView = pDescriptorWrites[i].pTexelBufferView[d];
                }
                else if(pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER ||
                        pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER ||
                        pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE ||
                        pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_STORAGE_IMAGE ||
                        pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT)
                {
                    bind.imageInfo = pDescriptorWrites[i].pImageInfo[d];

                    // ignore descriptors not part of the write, by NULL'ing out those members
                    // as they might not even point to a valid object
                    if(pDescriptorWrites[i].descriptorType == VK_DESCRIPTOR_TYPE_SAMPLER)
                        bind.imageInfo.imageView = VK_NULL_HANDLE;
                    else if(pDescriptorWrites[i].descriptorType != VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER)
                        bind.imageInfo.sampler = VK_NULL_HANDLE;
                }
                else
                {
                    bind.bufferInfo = pDescriptorWrites[i].pBufferInfo[d];
                }

                if(bind.texelBufferView != VK_NULL_HANDLE)
                {
                    record->AddBindFrameRef(GetResID(bind.texelBufferView), eFrameRef_Read, GetRecord(bind.texelBufferView)->sparseInfo != NULL);
                    if(GetRecord(bind.texelBufferView)->baseResource != ResourceId())
                        record->AddBindFrameRef(GetRecord(bind.texelBufferView)->baseResource, ref);
                }
                if(bind.imageInfo.imageView != VK_NULL_HANDLE)
                {
                    record->AddBindFrameRef(GetResID(bind.imageInfo.imageView), eFrameRef_Read, GetRecord(bind.imageInfo.imageView)->sparseInfo != NULL);
                    record->AddBindFrameRef(GetRecord(bind.imageInfo.imageView)->baseResource, ref);
                    if(GetRecord(bind.imageInfo.imageView)->baseResourceMem != ResourceId())
                        record->AddBindFrameRef(GetRecord(bind.imageInfo.imageView)->baseResourceMem, eFrameRef_Read);
                }
                if(bind.imageInfo.sampler != VK_NULL_HANDLE)
                {
                    record->AddBindFrameRef(GetResID(bind.imageInfo.sampler), eFrameRef_Read);
                }
                if(bind.bufferInfo.buffer != VK_NULL_HANDLE)
                {
                    record->AddBindFrameRef(GetResID(bind.bufferInfo.buffer), eFrameRef_Read, GetRecord(bind.bufferInfo.buffer)->sparseInfo != NULL);
                    if(GetRecord(bind.bufferInfo.buffer)->baseResource != ResourceId())
                        record->AddBindFrameRef(GetRecord(bind.bufferInfo.buffer)->baseResource, ref);
                }
            }
        }

        // this is almost identical to the above loop, except that instead of sourcing the descriptors
        // from the writedescriptor struct, we source it from our stored bindings on the source
        // descrpitor set

        for(uint32_t i=0; i < copyCount; i++)
        {
            VkResourceRecord *dstrecord = GetRecord(pDescriptorCopies[i].dstSet);
            RDCASSERT(dstrecord->descInfo && dstrecord->descInfo->layout);
            const DescSetLayout &layout = *dstrecord->descInfo->layout;
开发者ID:Zorro666,项目名称:renderdoc,代码行数:67,代码来源:vk_descriptor_funcs.cpp


注:本文中的VkResourceRecord::AddBindFrameRef方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。