Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
GrD3DCommandSignature.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2020 Google LLC
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
9
11
13 unsigned int slot) {
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
static sk_sp< GrD3DCommandSignature > Make(GrD3DGpu *gpu, ForIndexed indexed, unsigned int slot)
ID3D12Device * device() const
Definition GrD3DGpu.h:43
#define SUCCEEDED(hr)