1818#include " src/gpu/d3d/GrD3DTextureResource.h"
1919#include " src/gpu/d3d/GrD3DUtil.h"
2020
21- GrD3DCommandList::GrD3DCommandList (gr_cp <ID3D12CommandAllocator> allocator,
22- gr_cp <ID3D12GraphicsCommandList> commandList)
21+ GrD3DCommandList::GrD3DCommandList (ComPtr <ID3D12CommandAllocator> allocator,
22+ ComPtr <ID3D12GraphicsCommandList> commandList)
2323 : fCommandList(std::move(commandList))
2424 , fAllocator(std::move(allocator)) {
2525}
@@ -43,7 +43,7 @@ GrD3DCommandList::SubmitResult GrD3DCommandList::submit(ID3D12CommandQueue* queu
4343 return SubmitResult::kFailure ;
4444 }
4545 SkASSERT (!fIsActive );
46- ID3D12CommandList* ppCommandLists[] = { fCommandList .get () };
46+ ID3D12CommandList* ppCommandLists[] = { fCommandList .Get () };
4747 queue->ExecuteCommandLists (1 , ppCommandLists);
4848
4949 return SubmitResult::kSuccess ;
@@ -52,7 +52,7 @@ GrD3DCommandList::SubmitResult GrD3DCommandList::submit(ID3D12CommandQueue* queu
5252void GrD3DCommandList::reset () {
5353 SkASSERT (!fIsActive );
5454 GR_D3D_CALL_ERRCHECK (fAllocator ->Reset ());
55- GR_D3D_CALL_ERRCHECK (fCommandList ->Reset (fAllocator .get (), nullptr ));
55+ GR_D3D_CALL_ERRCHECK (fCommandList ->Reset (fAllocator .Get (), nullptr ));
5656 this ->onReset ();
5757
5858 this ->releaseResources ();
@@ -200,21 +200,21 @@ void GrD3DCommandList::addingWork() {
200200// //////////////////////////////////////////////////////////////////////////////////////////////////
201201
202202std::unique_ptr<GrD3DDirectCommandList> GrD3DDirectCommandList::Make (ID3D12Device* device) {
203- gr_cp <ID3D12CommandAllocator> allocator;
203+ ComPtr <ID3D12CommandAllocator> allocator;
204204 GR_D3D_CALL_ERRCHECK (device->CreateCommandAllocator (
205205 D3D12_COMMAND_LIST_TYPE_DIRECT, IID_PPV_ARGS (&allocator)));
206206
207- gr_cp <ID3D12GraphicsCommandList> commandList;
207+ ComPtr <ID3D12GraphicsCommandList> commandList;
208208 GR_D3D_CALL_ERRCHECK (device->CreateCommandList (0 , D3D12_COMMAND_LIST_TYPE_DIRECT,
209- allocator.get (), nullptr ,
209+ allocator.Get (), nullptr ,
210210 IID_PPV_ARGS (&commandList)));
211211
212212 auto grCL = new GrD3DDirectCommandList (std::move (allocator), std::move (commandList));
213213 return std::unique_ptr<GrD3DDirectCommandList>(grCL);
214214}
215215
216- GrD3DDirectCommandList::GrD3DDirectCommandList (gr_cp <ID3D12CommandAllocator> allocator,
217- gr_cp <ID3D12GraphicsCommandList> commandList)
216+ GrD3DDirectCommandList::GrD3DDirectCommandList (ComPtr <ID3D12CommandAllocator> allocator,
217+ ComPtr <ID3D12GraphicsCommandList> commandList)
218218 : GrD3DCommandList(std::move(allocator), std::move(commandList))
219219 , fCurrentPipelineState(nullptr )
220220 , fCurrentRootSignature(nullptr )
@@ -281,7 +281,7 @@ void GrD3DDirectCommandList::setViewports(unsigned int numViewports,
281281
282282void GrD3DDirectCommandList::setCenteredSamplePositions (unsigned int numSamples) {
283283 if (!fUsingCenteredSamples && numSamples > 1 ) {
284- gr_cp <ID3D12GraphicsCommandList1> commandList1;
284+ ComPtr <ID3D12GraphicsCommandList1> commandList1;
285285 GR_D3D_CALL_ERRCHECK (fCommandList ->QueryInterface (IID_PPV_ARGS (&commandList1)));
286286 static D3D12_SAMPLE_POSITION kCenteredSampleLocations [16 ] = {};
287287 commandList1->SetSamplePositions (numSamples, 1 , kCenteredSampleLocations );
@@ -291,7 +291,7 @@ void GrD3DDirectCommandList::setCenteredSamplePositions(unsigned int numSamples)
291291
292292void GrD3DDirectCommandList::setDefaultSamplePositions () {
293293 if (fUsingCenteredSamples ) {
294- gr_cp <ID3D12GraphicsCommandList1> commandList1;
294+ ComPtr <ID3D12GraphicsCommandList1> commandList1;
295295 GR_D3D_CALL_ERRCHECK (fCommandList ->QueryInterface (IID_PPV_ARGS (&commandList1)));
296296 commandList1->SetSamplePositions (0 , 0 , nullptr );
297297 fUsingCenteredSamples = false ;
@@ -442,7 +442,7 @@ void GrD3DDirectCommandList::resolveSubresourceRegion(const GrD3DTextureResource
442442 this ->addResource (dstTexture->resource ());
443443 this ->addResource (srcTexture->resource ());
444444
445- gr_cp <ID3D12GraphicsCommandList1> commandList1;
445+ ComPtr <ID3D12GraphicsCommandList1> commandList1;
446446 HRESULT result = fCommandList ->QueryInterface (IID_PPV_ARGS (&commandList1));
447447 if (SUCCEEDED (result)) {
448448 commandList1->ResolveSubresourceRegion (dstTexture->d3dResource (), 0 , dstX, dstY,
@@ -503,18 +503,18 @@ void GrD3DDirectCommandList::addSampledTextureRef(GrD3DTexture* texture) {
503503// //////////////////////////////////////////////////////////////////////////////////////////////////
504504
505505std::unique_ptr<GrD3DCopyCommandList> GrD3DCopyCommandList::Make (ID3D12Device* device) {
506- gr_cp <ID3D12CommandAllocator> allocator;
506+ ComPtr <ID3D12CommandAllocator> allocator;
507507 GR_D3D_CALL_ERRCHECK (device->CreateCommandAllocator (D3D12_COMMAND_LIST_TYPE_DIRECT,
508508 IID_PPV_ARGS (&allocator)));
509509
510- gr_cp <ID3D12GraphicsCommandList> commandList;
511- GR_D3D_CALL_ERRCHECK (device->CreateCommandList (0 , D3D12_COMMAND_LIST_TYPE_COPY, allocator.get (),
510+ ComPtr <ID3D12GraphicsCommandList> commandList;
511+ GR_D3D_CALL_ERRCHECK (device->CreateCommandList (0 , D3D12_COMMAND_LIST_TYPE_COPY, allocator.Get (),
512512 nullptr , IID_PPV_ARGS (&commandList)));
513513 auto grCL = new GrD3DCopyCommandList (std::move (allocator), std::move (commandList));
514514 return std::unique_ptr<GrD3DCopyCommandList>(grCL);
515515}
516516
517- GrD3DCopyCommandList::GrD3DCopyCommandList (gr_cp <ID3D12CommandAllocator> allocator,
518- gr_cp <ID3D12GraphicsCommandList> commandList)
517+ GrD3DCopyCommandList::GrD3DCopyCommandList (ComPtr <ID3D12CommandAllocator> allocator,
518+ ComPtr <ID3D12GraphicsCommandList> commandList)
519519 : GrD3DCommandList(std::move(allocator), std::move(commandList)) {
520520}
0 commit comments