Function create

Summary

#include <Source/Falcor/Core/API/ResourceViews.h>

(1) static SharedPtr create(ConstTextureSharedPtrRef pTexture, uint32_t mostDetailedMip, uint32_t mipCount, uint32_t firstArraySlice, uint32_t arraySize)

(2) static SharedPtr create(ConstBufferSharedPtrRef pBuffer, uint32_t firstElement, uint32_t elementCount)

(3) static SharedPtr create(Dimension dimension)

Function overload

Synopsis

#include <Source/Falcor/Core/API/ResourceViews.h>

static SharedPtr create(ConstTextureSharedPtrRef pTexture, uint32_t mostDetailedMip, uint32_t mipCount, uint32_t firstArraySlice, uint32_t arraySize)

Description

No description yet.

Source

Lines 421-428 in Source/Falcor/Core/API/D3D12/D3D12ResourceViews.cpp. Line 126 in Source/Falcor/Core/API/ResourceViews.h.

ShaderResourceView::SharedPtr ShaderResourceView::create(ConstTextureSharedPtrRef pTexture, uint32_t mostDetailedMip, uint32_t mipCount, uint32_t firstArraySlice, uint32_t arraySize)
{
    assert(pTexture);
    D3D12_SHADER_RESOURCE_VIEW_DESC desc = createTextureSrvDesc(pTexture.get(), firstArraySlice, arraySize, mostDetailedMip, mipCount);
    Resource::ApiHandle resHandle = pTexture->getApiHandle();
    return SharedPtr(new ShaderResourceView(pTexture, createSrvDescriptor(desc, resHandle), mostDetailedMip, mipCount, firstArraySlice, arraySize));
}

Synopsis

#include <Source/Falcor/Core/API/ResourceViews.h>

static SharedPtr create(ConstBufferSharedPtrRef pBuffer, uint32_t firstElement, uint32_t elementCount)

Description

No description yet.

Source

Lines 430-437 in Source/Falcor/Core/API/D3D12/D3D12ResourceViews.cpp. Line 127 in Source/Falcor/Core/API/ResourceViews.h.

ShaderResourceView::SharedPtr ShaderResourceView::create(ConstBufferSharedPtrRef pBuffer, uint32_t firstElement, uint32_t elementCount)
{
    assert(pBuffer);
    D3D12_SHADER_RESOURCE_VIEW_DESC desc = createBufferSrvDesc(pBuffer.get(), firstElement, elementCount);
    Resource::ApiHandle resHandle = pBuffer->getApiHandle();
    return SharedPtr(new ShaderResourceView(pBuffer, createSrvDescriptor(desc, resHandle), firstElement, elementCount));
}

Synopsis

#include <Source/Falcor/Core/API/ResourceViews.h>

static SharedPtr create(Dimension dimension)

Description

No description yet.

Source

Lines 439-448 in Source/Falcor/Core/API/D3D12/D3D12ResourceViews.cpp. Line 128 in Source/Falcor/Core/API/ResourceViews.h.

ShaderResourceView::SharedPtr ShaderResourceView::create(Dimension dimension)
{
    // Create a null view of the specified dimension.
    D3D12_SHADER_RESOURCE_VIEW_DESC desc = {};
    desc.Format = (dimension == Dimension::AccelerationStructure ? DXGI_FORMAT_UNKNOWN : DXGI_FORMAT_R32_UINT);
    desc.ViewDimension = getViewDimension<decltype(desc.ViewDimension)>(dimension);
    desc.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
    return SharedPtr(new ShaderResourceView(std::weak_ptr<Resource>(), createSrvDescriptor(desc, nullptr), 0, 0));
}





Add Discussion as Guest

Log in