Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Static Public Member Functions | List of all members
GrD3DCommandSignature Class Reference

#include <GrD3DCommandSignature.h>

Inheritance diagram for GrD3DCommandSignature:
GrManagedResource SkNoncopyable

Public Types

enum class  ForIndexed : bool { kYes = true , kNo = false }
 

Public Member Functions

bool isCompatible (ForIndexed indexed, unsigned int slot) const
 
ID3D12CommandSignature * commandSignature () const
 
- Public Member Functions inherited from GrManagedResource
 GrManagedResource ()
 
virtual ~GrManagedResource ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Static Public Member Functions

static sk_sp< GrD3DCommandSignatureMake (GrD3DGpu *gpu, ForIndexed indexed, unsigned int slot)
 

Detailed Description

Definition at line 16 of file GrD3DCommandSignature.h.

Member Enumeration Documentation

◆ ForIndexed

enum class GrD3DCommandSignature::ForIndexed : bool
strong
Enumerator
kYes 
kNo 

Definition at line 18 of file GrD3DCommandSignature.h.

18 : bool {
19 kYes = true,
20 kNo = false
21 };
@ kYes
Do pre-clip the geometry before applying the (perspective) matrix.
@ kNo
Don't pre-clip the geometry before applying the (perspective) matrix.

Member Function Documentation

◆ commandSignature()

ID3D12CommandSignature * GrD3DCommandSignature::commandSignature ( ) const
inline

Definition at line 28 of file GrD3DCommandSignature.h.

28{ return fCommandSignature.get(); }
T * get() const
Definition: GrD3DTypes.h:108

◆ isCompatible()

bool GrD3DCommandSignature::isCompatible ( ForIndexed  indexed,
unsigned int  slot 
) const
inline

Definition at line 24 of file GrD3DCommandSignature.h.

24 {
25 return (fIndexed == indexed && fSlot == slot);
26 }

◆ Make()

sk_sp< GrD3DCommandSignature > GrD3DCommandSignature::Make ( GrD3DGpu gpu,
ForIndexed  indexed,
unsigned int  slot 
)
static

Definition at line 12 of file GrD3DCommandSignature.cpp.

13 {
14 bool indexed = (forIndexed == ForIndexed::kYes);
15 D3D12_INDIRECT_ARGUMENT_DESC argumentDesc = {};
16 argumentDesc.Type = indexed ? D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED
17 : D3D12_INDIRECT_ARGUMENT_TYPE_DRAW;
18 argumentDesc.VertexBuffer.Slot = slot;
19
20 D3D12_COMMAND_SIGNATURE_DESC commandSigDesc = {};
21 commandSigDesc.ByteStride = indexed ? sizeof(D3D12_DRAW_INDEXED_ARGUMENTS)
22 : sizeof(D3D12_DRAW_ARGUMENTS);
23 commandSigDesc.NumArgumentDescs = 1;
24 commandSigDesc.pArgumentDescs = &argumentDesc;
25 commandSigDesc.NodeMask = 0;
26
28 HRESULT hr = gpu->device()->CreateCommandSignature(&commandSigDesc, nullptr,
29 IID_PPV_ARGS(&commandSig));
30 if (!SUCCEEDED(hr)) {
31 SkDebugf("Failed to create command signature.\n");
32 return nullptr;
33 }
34
35 return sk_sp<GrD3DCommandSignature>(new GrD3DCommandSignature(std::move(commandSig),
36 forIndexed, slot));
37}
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
ID3D12Device * device() const
Definition: GrD3DGpu.h:43
#define SUCCEEDED(hr)

The documentation for this class was generated from the following files: