Share via


D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS struttura (d3d12.h)

Definisce gli input per un'operazione di compilazione della struttura di accelerazione raytracing. Questa struttura viene usata da ID3D12GraphicsCommandList4::BuildRaytracingAccelerationStructure e ID3D12Device5::GetRaytracingAccelerationStructurePrebuildInfo.

Sintassi

typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS {
  D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE        Type;
  D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS Flags;
  UINT                                                NumDescs;
  D3D12_ELEMENTS_LAYOUT                               DescsLayout;
  union {
    D3D12_GPU_VIRTUAL_ADDRESS            InstanceDescs;
    const D3D12_RAYTRACING_GEOMETRY_DESC *pGeometryDescs;
    const D3D12_RAYTRACING_GEOMETRY_DESC const * * ppGeometryDescs;
  };
} D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS;

Members

Type

Tipo di struttura di accelerazione da compilare.

Flags

Flag di compilazione.

NumDescs

Se Type è D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TOP_LEVEL, questo valore è il numero di istanze, disposto in base a DescsLayout.

Se Type è D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BOTTOM_LEVEL, questo valore è il numero di elementi a cui fa riferimento pGeometryDescs o ppGeometryDescs. Quale di questi campi viene utilizzata dipende da DescsLayout.

DescsLayout

Modalità di specifica delle descrizioni geometry; matrice di descrizioni o matrice di puntatori alle descrizioni.

InstanceDescs

Se Type è D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TOP_LEVEL, si riferisce alle strutture NumDescsD3D12_RAYTRACING_INSTANCE_DESC in memoria GPU che descrivono le istanze. Ogni istanza deve essere allineata a 16 byte, definita come D3D12_RAYTRACING_INSTANCE_DESC_BYTE_ALIGNMENT.

Se Type non è D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TOP_LEVEL, questo parametro non viene usato.

Se DescLayout è D3D12_ELEMENTS_LAYOUT_ARRAY, InstanceDescs punta a una matrice di descrizioni di istanze in memoria GPU.

Se DescLayout è D3D12_ELEMENTS_LAYOUT_ARRAY_OF_POINTERS, InstanceDescs punta a una matrice in memoria GPU di D3D12_GPU_VIRTUAL_ADDRESS puntatori alle descrizioni delle istanze.

La memoria a cui punta deve essere in stato D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE.

pGeometryDescs

Se Type è D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BOTTOM_LEVEL e DescsLayout è D3D12_ELEMENTS_LAYOUT_ARRAY, questo campo viene usato e punta a strutture contigue D3D12_RAYTRACING_GEOMETRY_DESCNumDescs sulla CPU, descrivendo le singole geometrie.

Se Type non è D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BOTTOM_LEVEL o DescsLayout non è D3D12_ELEMENTS_LAYOUT_ARRAY, questo parametro non viene utilizzato.

ppGeometryDescs

Se Type è D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BOTTOM_LEVEL e DescsLayout è D3D12_ELEMENTS_LAYOUT_ARRAY_OF_POINTERS, questo campo viene usato e punta a una matrice di puntatori NumDescs per D3D12_RAYTRACING_GEOMETRY_DESC strutture sulla CPU, descrivendo le singole geometrie.

Commenti

Quando viene usato con GetRaytracingAccelerationStructurePrebuildInfo, che esegue effettivamente una compilazione, qualsiasi parametro a cui viene fatto riferimento tramite D3D12_GPU_VIRTUAL_ADDRESS (un indirizzo in memoria GPU), ad esempio InstanceDescs, non sarà accessibile dall'operazione. Quindi questa memoria non deve essere ancora inizializzata o essere in uno stato di risorsa specifico. Se gli indirizzi GPU sono null o meno possono essere controllati dall'operazione, anche se i puntatori non sono dereferenziati.

Requisiti

Requisito Valore
Intestazione d3d12.h