Flutter Engine
The Flutter Engine
Macros | Functions
GrD3DBuffer.cpp File Reference
#include "src/gpu/ganesh/d3d/GrD3DBuffer.h"
#include "src/gpu/ganesh/d3d/GrD3DGpu.h"
#include "src/gpu/ganesh/d3d/GrD3DUtil.h"

Go to the source code of this file.

Macros

#define VALIDATE()   do {} while(false)
 

Functions

static gr_cp< ID3D12Resource > make_d3d_buffer (GrD3DGpu *gpu, size_t size, GrGpuBufferType intendedType, GrAccessPattern accessPattern, D3D12_RESOURCE_STATES *resourceState, sk_sp< GrD3DAlloc > *alloc)
 

Macro Definition Documentation

◆ VALIDATE

#define VALIDATE ( )    do {} while(false)

Definition at line 16 of file GrD3DBuffer.cpp.

Function Documentation

◆ make_d3d_buffer()

static gr_cp< ID3D12Resource > make_d3d_buffer ( GrD3DGpu gpu,
size_t  size,
GrGpuBufferType  intendedType,
GrAccessPattern  accessPattern,
D3D12_RESOURCE_STATES *  resourceState,
sk_sp< GrD3DAlloc > *  alloc 
)
static

Definition at line 19 of file GrD3DBuffer.cpp.

24 {
25 D3D12_HEAP_TYPE heapType;
26 if (accessPattern == kStatic_GrAccessPattern) {
28 intendedType != GrGpuBufferType::kXferGpuToCpu);
29 heapType = D3D12_HEAP_TYPE_DEFAULT;
30 // Needs to be transitioned to appropriate state to be read in shader
31 *resourceState = D3D12_RESOURCE_STATE_COPY_DEST;
32 } else {
33 if (intendedType == GrGpuBufferType::kXferGpuToCpu) {
34 heapType = D3D12_HEAP_TYPE_READBACK;
35 // Cannot be changed
36 *resourceState = D3D12_RESOURCE_STATE_COPY_DEST;
37 } else {
38 heapType = D3D12_HEAP_TYPE_UPLOAD;
39 // Cannot be changed
40 // Includes VERTEX_AND_CONSTANT_BUFFER, INDEX_BUFFER, INDIRECT_ARGUMENT, and COPY_SOURCE
41 *resourceState = D3D12_RESOURCE_STATE_GENERIC_READ;
42 }
43 }
44
45 D3D12_RESOURCE_DESC bufferDesc = {};
46 bufferDesc.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;
47 bufferDesc.Alignment = 0; // default alignment
48 bufferDesc.Width = size;
49 bufferDesc.Height = 1;
50 bufferDesc.DepthOrArraySize = 1;
51 bufferDesc.MipLevels = 1;
52 bufferDesc.Format = DXGI_FORMAT_UNKNOWN;
53 bufferDesc.SampleDesc.Count = 1;
54 bufferDesc.SampleDesc.Quality = 0; // Doesn't apply to buffers
55 bufferDesc.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;
56 bufferDesc.Flags = D3D12_RESOURCE_FLAG_NONE;
57
59 heapType, &bufferDesc, *resourceState, alloc, nullptr);
60
61 return resource;
62}
@ kStatic_GrAccessPattern
Definition: GrTypesPriv.h:428
#define SkASSERT(cond)
Definition: SkAssert.h:116
static SkString resource(SkPDFResourceType type, int index)
GrD3DMemoryAllocator * memoryAllocator() const
Definition: GrD3DGpu.h:46
virtual gr_cp< ID3D12Resource > createResource(D3D12_HEAP_TYPE, const D3D12_RESOURCE_DESC *, D3D12_RESOURCE_STATES initialResourceState, sk_sp< GrD3DAlloc > *allocation, const D3D12_CLEAR_VALUE *)=0
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259