Remove Swapchain SRV (no use)
Removed useless parameters in the root signature various small changes Began removing staging descriptor to use unified descriptors
This commit is contained in:
@@ -226,30 +226,7 @@ namespace Juliet::D3D12
|
||||
.RegisterSpace = 0,
|
||||
.Num32BitValues = 58, // 58 because each root cbv takes 2 uints, and the max is 64
|
||||
},
|
||||
};
|
||||
|
||||
parameters[ToUnderlying(RootParameters::PassCBV)] = {
|
||||
.ParameterType = D3D12_ROOT_PARAMETER_TYPE_CBV,
|
||||
.Descriptor = {
|
||||
.ShaderRegister = 1,
|
||||
.Flags = D3D12_ROOT_DESCRIPTOR_FLAG_DATA_VOLATILE,
|
||||
},
|
||||
};
|
||||
|
||||
parameters[ToUnderlying(RootParameters::ViewCBV)] = {
|
||||
.ParameterType = D3D12_ROOT_PARAMETER_TYPE_CBV,
|
||||
.Descriptor = {
|
||||
.ShaderRegister = 2,
|
||||
.Flags = D3D12_ROOT_DESCRIPTOR_FLAG_DATA_VOLATILE,
|
||||
},
|
||||
};
|
||||
|
||||
parameters[ToUnderlying(RootParameters::GlobalCBV)] = {
|
||||
.ParameterType = D3D12_ROOT_PARAMETER_TYPE_CBV,
|
||||
.Descriptor = {
|
||||
.ShaderRegister = 3,
|
||||
.Flags = D3D12_ROOT_DESCRIPTOR_FLAG_DATA_VOLATILE,
|
||||
},
|
||||
.ShaderVisibility = D3D12_SHADER_VISIBILITY_ALL
|
||||
};
|
||||
|
||||
D3D12_STATIC_SAMPLER_DESC samplers[] = {
|
||||
@@ -275,7 +252,15 @@ namespace Juliet::D3D12
|
||||
.pParameters = parameters,
|
||||
.NumStaticSamplers = ArraySize(samplers),
|
||||
.pStaticSamplers = samplers,
|
||||
.Flags = D3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED,
|
||||
.Flags = D3D12_ROOT_SIGNATURE_FLAG_DENY_VERTEX_SHADER_ROOT_ACCESS |
|
||||
D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS |
|
||||
D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS |
|
||||
D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS |
|
||||
D3D12_ROOT_SIGNATURE_FLAG_DENY_PIXEL_SHADER_ROOT_ACCESS |
|
||||
D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS |
|
||||
D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS |
|
||||
D3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED |
|
||||
D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -20,9 +20,6 @@ namespace Juliet::D3D12
|
||||
enum class RootParameters : uint8
|
||||
{
|
||||
Constants32Bits,
|
||||
PassCBV,
|
||||
ViewCBV,
|
||||
GlobalCBV,
|
||||
Count,
|
||||
};
|
||||
|
||||
|
||||
@@ -106,18 +106,6 @@ namespace Juliet::D3D12
|
||||
texture->Container = textureContainer;
|
||||
texture->IndexInContainer = 0;
|
||||
|
||||
// Assign SRV to the swapchain texture
|
||||
Internal::AssignStagingDescriptor(driver, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, texture->SRVHandle);
|
||||
D3D12_SHADER_RESOURCE_VIEW_DESC srvDesc;
|
||||
srvDesc.Format = SwapchainCompositionToTextureFormat[ToUnderlying(composition)];
|
||||
srvDesc.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
|
||||
srvDesc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D;
|
||||
srvDesc.Texture2D.MipLevels = 1;
|
||||
srvDesc.Texture2D.MostDetailedMip = 0;
|
||||
srvDesc.Texture2D.ResourceMinLODClamp = 0;
|
||||
srvDesc.Texture2D.PlaneSlice = 0;
|
||||
ID3D12Device_CreateShaderResourceView(driver->D3D12Device, swapChainTexture, &srvDesc, texture->SRVHandle.CpuHandle);
|
||||
|
||||
// Assign RTV to the swapchain texture
|
||||
DXGI_FORMAT swapchainFormat = SwapchainCompositionToTextureFormat[ToUnderlying(composition)];
|
||||
Internal::AssignStagingDescriptor(driver, D3D12_DESCRIPTOR_HEAP_TYPE_RTV, texture->Subresources[0].RTVHandles[0]);
|
||||
@@ -373,7 +361,6 @@ namespace Juliet::D3D12
|
||||
{
|
||||
for (uint32 idx = 0; idx < windowData->SwapChainTextureCount; ++idx)
|
||||
{
|
||||
ReleaseStagingDescriptor(driver, windowData->SwapChainTextureContainers[idx].ActiveTexture->SRVHandle);
|
||||
ReleaseStagingDescriptor(driver,
|
||||
windowData->SwapChainTextureContainers[idx].ActiveTexture->Subresources[0].RTVHandles[0]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user