Flutter Engine
The Flutter Engine
GrD3DPipelineStateDataManager.cpp
Go to the documentation of this file.
1/*
2* Copyright 2016 Google Inc.
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
12
14 uint32_t uniformSize)
15 : INHERITED(uniforms.count(), uniformSize) {
16 // We must add uniforms in same order as the UniformInfoArray so that UniformHandles already
17 // owned by other objects will still match up here.
18 int i = 0;
19 for (const auto& uniformInfo : uniforms.items()) {
20 Uniform& uniform = fUniforms[i];
21 SkASSERT(GrShaderVar::kNonArray == uniformInfo.fVariable.getArrayCount() ||
22 uniformInfo.fVariable.getArrayCount() > 0);
24 uniform.fArrayCount = uniformInfo.fVariable.getArrayCount();
25 uniform.fType = uniformInfo.fVariable.getType();
26 )
27
28 uniform.fOffset = uniformInfo.fUBOOffset;
29 ++i;
30 }
31}
32
34 if (fUniformsDirty) {
35 fConstantBufferAddress = gpu->resourceProvider().uploadConstantData(fUniformData.get(),
37 fUniformsDirty = false;
38 }
39
40 return fConstantBufferAddress;
41}
int count
Definition: FontMgrTest.cpp:50
#define SkASSERT(cond)
Definition: SkAssert.h:116
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
GrD3DResourceProvider & resourceProvider()
Definition: GrD3DGpu.h:38
GrD3DPipelineStateDataManager(const UniformInfoArray &, uint32_t uniformSize)
D3D12_GPU_VIRTUAL_ADDRESS uploadConstants(GrD3DGpu *gpu)
D3D12_GPU_VIRTUAL_ADDRESS uploadConstantData(void *data, size_t size)
skia_private::TArray< Uniform, true > fUniforms
void * get()
Definition: SkAutoMalloc.h:64