Add GrD3DRootSignature class and support.
This is the last thing needed for creating the pipeline state so this change also starts creating the pipeline state and fixes errors involving it. Change-Id: Ifd1b63016d692d98cfa2a931957e857a5c53bec5 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/284527 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com> Reviewed-by: Michael Ludwig <michaelludwig@google.com>
This commit is contained in:
parent
5fc5c8128c
commit
c31edc0b38
@ -752,6 +752,8 @@ skia_direct3d_sources = [
|
||||
"$_src/gpu/d3d/GrD3DResourceProvider.cpp",
|
||||
"$_src/gpu/d3d/GrD3DResourceProvider.h",
|
||||
"$_src/gpu/d3d/GrD3DResourceState.h",
|
||||
"$_src/gpu/d3d/GrD3DRootSignature.cpp",
|
||||
"$_src/gpu/d3d/GrD3DRootSignature.h",
|
||||
"$_src/gpu/d3d/GrD3DStencilAttachment.cpp",
|
||||
"$_src/gpu/d3d/GrD3DStencilAttachment.h",
|
||||
"$_src/gpu/d3d/GrD3DTexture.cpp",
|
||||
|
@ -37,6 +37,8 @@ public:
|
||||
|
||||
const GrD3DCaps& d3dCaps() const { return static_cast<const GrD3DCaps&>(*fCaps); }
|
||||
|
||||
GrD3DResourceProvider& resourceProvider() { return fResourceProvider; }
|
||||
|
||||
ID3D12Device* device() const { return fDevice.get(); }
|
||||
ID3D12CommandQueue* queue() const { return fQueue.get(); }
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "src/gpu/GrProgramInfo.h"
|
||||
#include "src/gpu/GrStencilSettings.h"
|
||||
#include "src/gpu/d3d/GrD3DGpu.h"
|
||||
#include "src/gpu/d3d/GrD3DRootSignature.h"
|
||||
|
||||
static DXGI_FORMAT attrib_type_to_format(GrVertexAttribType type) {
|
||||
switch (type) {
|
||||
@ -93,11 +94,12 @@ static void setup_vertex_input_layout(const GrPrimitiveProcessor& primProc,
|
||||
vertexSlot, vertexAttributeOffset,
|
||||
D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0};
|
||||
vertexAttributeOffset += attrib.sizeAlign4();
|
||||
currentAttrib++;
|
||||
}
|
||||
SkASSERT(vertexAttributeOffset == primProc.vertexStride());
|
||||
|
||||
unsigned int instanceAttributeOffset = 0;
|
||||
for (const auto& attrib : primProc.vertexAttributes()) {
|
||||
for (const auto& attrib : primProc.instanceAttributes()) {
|
||||
// When using SPIRV-Cross it converts the location modifier in SPIRV to be
|
||||
// TEXCOORD<N> where N is the location value for eveery vertext attribute
|
||||
inputElements[currentAttrib] = {"TEXCOORD", currentAttrib,
|
||||
@ -105,8 +107,9 @@ static void setup_vertex_input_layout(const GrPrimitiveProcessor& primProc,
|
||||
instanceSlot, instanceAttributeOffset,
|
||||
D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0};
|
||||
instanceAttributeOffset += attrib.sizeAlign4();
|
||||
currentAttrib++;
|
||||
}
|
||||
SkASSERT(instanceAttributeOffset == primProc.vertexStride());
|
||||
SkASSERT(instanceAttributeOffset == primProc.instanceStride());
|
||||
}
|
||||
|
||||
static D3D12_BLEND blend_coeff_to_d3d_blend(GrBlendCoeff coeff) {
|
||||
@ -149,6 +152,28 @@ static D3D12_BLEND blend_coeff_to_d3d_blend(GrBlendCoeff coeff) {
|
||||
SkUNREACHABLE;
|
||||
}
|
||||
|
||||
static D3D12_BLEND blend_coeff_to_d3d_blend_for_alpha(GrBlendCoeff coeff) {
|
||||
switch (coeff) {
|
||||
// Force all srcColor used in alpha slot to alpha version.
|
||||
case kSC_GrBlendCoeff:
|
||||
return D3D12_BLEND_SRC_ALPHA;
|
||||
case kISC_GrBlendCoeff:
|
||||
return D3D12_BLEND_INV_SRC_ALPHA;
|
||||
case kDC_GrBlendCoeff:
|
||||
return D3D12_BLEND_DEST_ALPHA;
|
||||
case kIDC_GrBlendCoeff:
|
||||
return D3D12_BLEND_INV_DEST_ALPHA;
|
||||
case kS2C_GrBlendCoeff:
|
||||
return D3D12_BLEND_SRC1_ALPHA;
|
||||
case kIS2C_GrBlendCoeff:
|
||||
return D3D12_BLEND_INV_SRC1_ALPHA;
|
||||
|
||||
default:
|
||||
return blend_coeff_to_d3d_blend(coeff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static D3D12_BLEND_OP blend_equation_to_d3d_op(GrBlendEquation equation) {
|
||||
switch (equation) {
|
||||
case kAdd_GrBlendEquation:
|
||||
@ -179,8 +204,8 @@ static void fill_in_blend_state(const GrPipeline& pipeline, D3D12_BLEND_DESC* bl
|
||||
rtBlend.SrcBlend = blend_coeff_to_d3d_blend(srcCoeff);
|
||||
rtBlend.DestBlend = blend_coeff_to_d3d_blend(dstCoeff);
|
||||
rtBlend.BlendOp = blend_equation_to_d3d_op(equation);
|
||||
rtBlend.SrcBlendAlpha = blend_coeff_to_d3d_blend(srcCoeff);
|
||||
rtBlend.DestBlendAlpha = blend_coeff_to_d3d_blend(dstCoeff);
|
||||
rtBlend.SrcBlendAlpha = blend_coeff_to_d3d_blend_for_alpha(srcCoeff);
|
||||
rtBlend.DestBlendAlpha = blend_coeff_to_d3d_blend_for_alpha(dstCoeff);
|
||||
rtBlend.BlendOpAlpha = blend_equation_to_d3d_op(equation);
|
||||
}
|
||||
|
||||
@ -289,9 +314,27 @@ static void fill_in_depth_stencil_state(const GrProgramInfo& programInfo,
|
||||
}
|
||||
}
|
||||
|
||||
static D3D12_PRIMITIVE_TOPOLOGY_TYPE gr_primitive_type_to_d3d(GrPrimitiveType primitiveType) {
|
||||
switch (primitiveType) {
|
||||
case GrPrimitiveType::kTriangles:
|
||||
case GrPrimitiveType::kTriangleStrip: //fall through
|
||||
return D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
|
||||
case GrPrimitiveType::kPoints:
|
||||
return D3D12_PRIMITIVE_TOPOLOGY_TYPE_POINT;
|
||||
case GrPrimitiveType::kLines: // fall through
|
||||
case GrPrimitiveType::kLineStrip:
|
||||
return D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE;
|
||||
case GrPrimitiveType::kPatches:
|
||||
return D3D12_PRIMITIVE_TOPOLOGY_TYPE_PATCH;
|
||||
case GrPrimitiveType::kPath: // fall through, unsupported
|
||||
default:
|
||||
SkUNREACHABLE;
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<GrD3DPipelineState> GrD3DPipelineState::Make(GrD3DGpu* gpu,
|
||||
const GrProgramInfo& programInfo,
|
||||
gr_cp<ID3D12RootSignature> rootSig,
|
||||
sk_sp<GrD3DRootSignature> rootSig,
|
||||
gr_cp<ID3DBlob> vertexShader,
|
||||
gr_cp<ID3DBlob> geometryShader,
|
||||
gr_cp<ID3DBlob> pixelShader,
|
||||
@ -300,6 +343,8 @@ std::unique_ptr<GrD3DPipelineState> GrD3DPipelineState::Make(GrD3DGpu* gpu,
|
||||
unsigned int sampleQualityLevel) {
|
||||
D3D12_GRAPHICS_PIPELINE_STATE_DESC psoDesc = {};
|
||||
|
||||
psoDesc.pRootSignature = rootSig->rootSignature();
|
||||
|
||||
psoDesc.VS = { reinterpret_cast<UINT8*>(vertexShader->GetBufferPointer()),
|
||||
vertexShader->GetBufferSize() };
|
||||
psoDesc.PS = { reinterpret_cast<UINT8*>(pixelShader->GetBufferPointer()),
|
||||
@ -323,15 +368,18 @@ std::unique_ptr<GrD3DPipelineState> GrD3DPipelineState::Make(GrD3DGpu* gpu,
|
||||
programInfo.primProc().numInstanceAttributes();
|
||||
SkAutoSTArray<4, D3D12_INPUT_ELEMENT_DESC> inputElements(totalAttributeCnt);
|
||||
setup_vertex_input_layout(programInfo.primProc(), inputElements.get());
|
||||
|
||||
psoDesc.InputLayout = { inputElements.get(), totalAttributeCnt };
|
||||
|
||||
psoDesc.IBStripCutValue = D3D12_INDEX_BUFFER_STRIP_CUT_VALUE_DISABLED;
|
||||
|
||||
// This is for geometry or hull shader primitives
|
||||
psoDesc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_UNDEFINED;
|
||||
psoDesc.PrimitiveTopologyType = gr_primitive_type_to_d3d(programInfo.primitiveType());
|
||||
|
||||
psoDesc.NumRenderTargets = 1;
|
||||
|
||||
psoDesc.RTVFormats[0] = renderTargetFormat;
|
||||
|
||||
psoDesc.DSVFormat = depthStencilFormat;
|
||||
|
||||
unsigned int numRasterSamples = programInfo.numRasterSamples();
|
||||
@ -343,10 +391,10 @@ std::unique_ptr<GrD3DPipelineState> GrD3DPipelineState::Make(GrD3DGpu* gpu,
|
||||
psoDesc.CachedPSO = {nullptr, 0};
|
||||
psoDesc.Flags = D3D12_PIPELINE_STATE_FLAG_NONE;
|
||||
|
||||
// TODO: We need to create a real root descriptor before trying to make a pipeline
|
||||
#if 0
|
||||
ThrowIfFailed(m_device->CreateGraphicsPipelineState(&psoDesc, IID_PPV_ARGS(&m_pipelineState)));
|
||||
#endif
|
||||
gr_cp<ID3D12PipelineState> pipelineState;
|
||||
SkDEBUGCODE(HRESULT hr = )gpu->device()->CreateGraphicsPipelineState(
|
||||
&psoDesc, IID_PPV_ARGS(&pipelineState));
|
||||
SkASSERT(SUCCEEDED(hr));
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -8,17 +8,19 @@
|
||||
#ifndef GrD3DPipelineState_DEFINED
|
||||
#define GrD3DPipelineState_DEFINED
|
||||
|
||||
#include "include/core/SkRefCnt.h"
|
||||
#include "include/gpu/GrTypes.h"
|
||||
#include "include/gpu/d3d/GrD3DTypes.h"
|
||||
#include <memory>
|
||||
|
||||
class GrD3DGpu;
|
||||
class GrD3DRootSignature;
|
||||
class GrProgramInfo;
|
||||
|
||||
class GrD3DPipelineState {
|
||||
public:
|
||||
static std::unique_ptr<GrD3DPipelineState> Make(GrD3DGpu* gpu, const GrProgramInfo&,
|
||||
gr_cp<ID3D12RootSignature> rootSig,
|
||||
sk_sp<GrD3DRootSignature> rootSig,
|
||||
gr_cp<ID3DBlob> vertexShader,
|
||||
gr_cp<ID3DBlob> geometryShader,
|
||||
gr_cp<ID3DBlob> pixelShader,
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "src/gpu/GrStencilSettings.h"
|
||||
#include "src/gpu/d3d/GrD3DGpu.h"
|
||||
#include "src/gpu/d3d/GrD3DRenderTarget.h"
|
||||
#include "src/gpu/d3d/GrD3DRootSignature.h"
|
||||
#include "src/sksl/SkSLCompiler.h"
|
||||
|
||||
#include <d3dcompiler.h>
|
||||
@ -162,10 +163,14 @@ std::unique_ptr<GrD3DPipelineState> GrD3DPipelineStateBuilder::finalize() {
|
||||
}
|
||||
}
|
||||
|
||||
gr_cp<ID3D12RootSignature> rootSignature;
|
||||
sk_sp<GrD3DRootSignature> rootSig =
|
||||
fGpu->resourceProvider().findOrCreateRootSignature(fUniformHandler.fTextures.count());
|
||||
if (!rootSig) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const GrD3DRenderTarget* rt = static_cast<const GrD3DRenderTarget*>(fRenderTarget);
|
||||
return GrD3DPipelineState::Make(fGpu, fProgramInfo, std::move(rootSignature),
|
||||
return GrD3DPipelineState::Make(fGpu, fProgramInfo, std::move(rootSig),
|
||||
std::move(vertexShader), std::move(geometryShader),
|
||||
std::move(pixelShader), rt->dxgiFormat(),
|
||||
rt->stencilDxgiFormat(), rt->sampleQualityLevel());
|
||||
|
@ -28,3 +28,18 @@ void GrD3DResourceProvider::recycleDirectCommandList(
|
||||
commandList->reset();
|
||||
fAvailableDirectCommandLists.push_back(std::move(commandList));
|
||||
}
|
||||
|
||||
sk_sp<GrD3DRootSignature> GrD3DResourceProvider::findOrCreateRootSignature(int numTextureSamplers) {
|
||||
for (int i = 0; i < fRootSignatures.count(); ++i) {
|
||||
if (fRootSignatures[i]->isCompatible(numTextureSamplers)) {
|
||||
return fRootSignatures[i];
|
||||
}
|
||||
}
|
||||
|
||||
auto rootSig = GrD3DRootSignature::Make(fGpu, numTextureSamplers);
|
||||
if (!rootSig) {
|
||||
return nullptr;
|
||||
}
|
||||
fRootSignatures.push_back(rootSig);
|
||||
return rootSig;
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
#include "include/gpu/d3d/GrD3DTypes.h"
|
||||
#include "include/private/SkTArray.h"
|
||||
#include "src/gpu/d3d/GrD3DRootSignature.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
@ -24,10 +25,13 @@ public:
|
||||
|
||||
void recycleDirectCommandList(std::unique_ptr<GrD3DDirectCommandList>);
|
||||
|
||||
sk_sp<GrD3DRootSignature> findOrCreateRootSignature(int numTextureSamplers);
|
||||
|
||||
private:
|
||||
GrD3DGpu* fGpu;
|
||||
|
||||
SkSTArray<4, std::unique_ptr<GrD3DDirectCommandList>> fAvailableDirectCommandLists;
|
||||
SkSTArray<4, sk_sp<GrD3DRootSignature>> fRootSignatures;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
116
src/gpu/d3d/GrD3DRootSignature.cpp
Normal file
116
src/gpu/d3d/GrD3DRootSignature.cpp
Normal file
@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Copyright 2020 Google LLC
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "src/gpu/d3d/GrD3DRootSignature.h"
|
||||
|
||||
#include "src/gpu/GrSpirvUniformHandler.h"
|
||||
#include "src/gpu/d3d/GrD3DGpu.h"
|
||||
|
||||
sk_sp<GrD3DRootSignature> GrD3DRootSignature::Make(GrD3DGpu* gpu, int numTextureSamplers) {
|
||||
// Just allocate enough space for 3 in case we need it.
|
||||
D3D12_ROOT_PARAMETER parameters[3];
|
||||
|
||||
// The first will always be our uniforms
|
||||
D3D12_DESCRIPTOR_RANGE uniformRange{};
|
||||
uniformRange.RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_CBV;
|
||||
uniformRange.NumDescriptors = 1;
|
||||
uniformRange.BaseShaderRegister = 0;
|
||||
// Spirv-Cross uses the descriptor set as the space in HSLS
|
||||
uniformRange.RegisterSpace = GrSpirvUniformHandler::kUniformDescriptorSet;
|
||||
uniformRange.OffsetInDescriptorsFromTableStart = D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND;
|
||||
|
||||
parameters[0].ParameterType = D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE;
|
||||
parameters[0].DescriptorTable.NumDescriptorRanges = 1;
|
||||
parameters[0].DescriptorTable.pDescriptorRanges = &uniformRange;
|
||||
parameters[0].ShaderVisibility = D3D12_SHADER_VISIBILITY_ALL;
|
||||
|
||||
SkAutoTArray<D3D12_DESCRIPTOR_RANGE> samplerRanges(numTextureSamplers);
|
||||
SkAutoTArray<D3D12_DESCRIPTOR_RANGE> textureRanges(numTextureSamplers);
|
||||
if (numTextureSamplers) {
|
||||
// Now handle the textures and samplers. We need a range for each sampler because of the
|
||||
// interaction between how we set bindings and spirv-cross. Each binding value is used for
|
||||
// the register value in the HLSL shader. So setting a binding of i for a texture will give
|
||||
// it register t[i] in HLSL. We set the bindings of textures and samplers in pairs with the
|
||||
// sampler at i and the corresponding texture at i+1. Thus no textures or samplers will have
|
||||
// a contiguous range of HLSL registers so we must define a different range for each.
|
||||
for (int i = 0; i < numTextureSamplers; ++i) {
|
||||
samplerRanges[i].RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_SAMPLER;
|
||||
samplerRanges[i].NumDescriptors = 1;
|
||||
samplerRanges[i].BaseShaderRegister = 2 * i;
|
||||
// Spirv-Cross uses the descriptor set as the space in HSLS
|
||||
samplerRanges[i].RegisterSpace = GrSpirvUniformHandler::kSamplerTextureDescriptorSet;
|
||||
// In the descriptor table the descriptors will all be contiguous.
|
||||
samplerRanges[i].OffsetInDescriptorsFromTableStart =
|
||||
D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND;
|
||||
|
||||
textureRanges[i].RangeType = D3D12_DESCRIPTOR_RANGE_TYPE_SRV;
|
||||
textureRanges[i].NumDescriptors = 1;
|
||||
textureRanges[i].BaseShaderRegister = 2 * i + 1;
|
||||
// Spirv-Cross uses the descriptor set as the space in HSLS
|
||||
textureRanges[i].RegisterSpace = GrSpirvUniformHandler::kSamplerTextureDescriptorSet;
|
||||
// In the descriptor table the descriptors will all be contiguous.
|
||||
textureRanges[i].OffsetInDescriptorsFromTableStart =
|
||||
D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND;
|
||||
}
|
||||
parameters[1].ParameterType = D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE;
|
||||
parameters[1].DescriptorTable.NumDescriptorRanges = numTextureSamplers;
|
||||
parameters[1].DescriptorTable.pDescriptorRanges = samplerRanges.get();
|
||||
parameters[1].ShaderVisibility = D3D12_SHADER_VISIBILITY_ALL;
|
||||
|
||||
parameters[2].ParameterType = D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE;
|
||||
parameters[2].DescriptorTable.NumDescriptorRanges = numTextureSamplers;
|
||||
parameters[2].DescriptorTable.pDescriptorRanges = textureRanges.get();
|
||||
parameters[2].ShaderVisibility = D3D12_SHADER_VISIBILITY_ALL;
|
||||
}
|
||||
|
||||
|
||||
D3D12_ROOT_SIGNATURE_DESC rootDesc{};
|
||||
// We always assume we at least have a parameter slot for uniforms. If we need textures, then we
|
||||
// need a descriptor table for the textures and another for the samplers.
|
||||
rootDesc.NumParameters = numTextureSamplers ? 3 : 1;
|
||||
rootDesc.pParameters = parameters;
|
||||
rootDesc.NumStaticSamplers = 0;
|
||||
rootDesc.pStaticSamplers = nullptr;
|
||||
rootDesc.Flags = D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT;
|
||||
|
||||
gr_cp<ID3DBlob> rootSigBinary;
|
||||
gr_cp<ID3DBlob> error;
|
||||
// TODO: D3D Static Function
|
||||
HRESULT hr = D3D12SerializeRootSignature(&rootDesc, D3D_ROOT_SIGNATURE_VERSION_1_0,
|
||||
&rootSigBinary, &error);
|
||||
|
||||
if (!SUCCEEDED(hr)) {
|
||||
SkDebugf("Failed to serialize root signature. Error: %s\n",
|
||||
reinterpret_cast<char*>(error->GetBufferPointer()));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
gr_cp<ID3D12RootSignature> rootSig;
|
||||
|
||||
hr = gpu->device()->CreateRootSignature(0, rootSigBinary->GetBufferPointer(),
|
||||
rootSigBinary->GetBufferSize(), IID_PPV_ARGS(&rootSig));
|
||||
if (!SUCCEEDED(hr)) {
|
||||
SkDebugf("Failed to create root signature.\n");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return sk_sp<GrD3DRootSignature>(new GrD3DRootSignature(std::move(rootSig),
|
||||
numTextureSamplers));
|
||||
}
|
||||
|
||||
GrD3DRootSignature::GrD3DRootSignature(gr_cp<ID3D12RootSignature> rootSig, int numTextureSamplers)
|
||||
: fRootSignature(std::move(rootSig))
|
||||
, fNumTextureSamplers(numTextureSamplers) {
|
||||
}
|
||||
|
||||
void GrD3DRootSignature::freeGPUData() const {
|
||||
fRootSignature.reset();
|
||||
}
|
||||
|
||||
bool GrD3DRootSignature::isCompatible(int numTextureSamplers) const {
|
||||
return fNumTextureSamplers == numTextureSamplers;
|
||||
}
|
43
src/gpu/d3d/GrD3DRootSignature.h
Normal file
43
src/gpu/d3d/GrD3DRootSignature.h
Normal file
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* Copyright 2020 Google LLC
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#ifndef GrD3DRootSignature_DEFINED
|
||||
#define GrD3DRootSignature_DEFINED
|
||||
|
||||
#include "include/gpu/d3d/GrD3DTypes.h"
|
||||
#include "src/gpu/GrManagedResource.h"
|
||||
|
||||
class GrD3DGpu;
|
||||
|
||||
class GrD3DRootSignature : public GrManagedResource {
|
||||
public:
|
||||
static sk_sp<GrD3DRootSignature> Make(GrD3DGpu* gpu, int numTextureSamplers);
|
||||
|
||||
bool isCompatible(int numTextureSamplers) const;
|
||||
|
||||
ID3D12RootSignature* rootSignature() const { return fRootSignature.get(); }
|
||||
|
||||
#ifdef SK_TRACE_MANAGED_RESOURCES
|
||||
/** Output a human-readable dump of this resource's information
|
||||
*/
|
||||
void dumpInfo() const override {
|
||||
SkDebugf("GrD3DRootSignature: %p, numTextures: %d (%d refs)\n",
|
||||
fRootSignature.get(), fNumTextureSamplers, this->getRefCnt());
|
||||
}
|
||||
#endif
|
||||
|
||||
private:
|
||||
GrD3DRootSignature(gr_cp<ID3D12RootSignature> rootSig, int numTextureSamplers);
|
||||
|
||||
void freeGPUData() const override;
|
||||
|
||||
// mutable needed so we can release the resource in freeGPUData
|
||||
mutable gr_cp<ID3D12RootSignature> fRootSignature;
|
||||
int fNumTextureSamplers;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user