d3d12: Use IID_PPV_ARGS instead of __uuidof
We've been inconsistent between IID_PPV_ARGS, __uuidof(var), and __uuidof(type). Since Linux doesn't support the latter of these, they need to be changed. While we're at it, switch all __uuidof to the more terse IIV_PPV_ARGS option. Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7937>
This commit is contained in:
@@ -56,8 +56,7 @@ d3d12_init_batch(struct d3d12_context *ctx, struct d3d12_batch *batch)
|
||||
util_dynarray_init(&batch->zombie_samplers, NULL);
|
||||
|
||||
if (FAILED(screen->dev->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT,
|
||||
__uuidof(batch->cmdalloc),
|
||||
(void **)&batch->cmdalloc)))
|
||||
IID_PPV_ARGS(&batch->cmdalloc))))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -173,8 +172,7 @@ d3d12_start_batch(struct d3d12_context *ctx, struct d3d12_batch *batch)
|
||||
} else {
|
||||
if (FAILED(screen->dev->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT,
|
||||
batch->cmdalloc, NULL,
|
||||
__uuidof(ctx->cmdlist),
|
||||
(void **)&ctx->cmdlist))) {
|
||||
IID_PPV_ARGS(&ctx->cmdlist)))) {
|
||||
debug_printf("D3D12: creating ID3D12GraphicsCommandList failed\n");
|
||||
batch->has_errors = true;
|
||||
return;
|
||||
|
||||
@@ -111,8 +111,7 @@ d3d12_bo_new(ID3D12Device *dev, uint64_t size, uint64_t alignment)
|
||||
&res_desc,
|
||||
D3D12_RESOURCE_STATE_COMMON,
|
||||
NULL,
|
||||
__uuidof(ID3D12Resource),
|
||||
(void **)&res);
|
||||
IID_PPV_ARGS(&res));
|
||||
|
||||
if (FAILED(hres))
|
||||
return NULL;
|
||||
|
||||
@@ -1945,8 +1945,7 @@ d3d12_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
|
||||
(PFN_D3D12_SERIALIZE_VERSIONED_ROOT_SIGNATURE)GetProcAddress(hD3D12Mod, "D3D12SerializeVersionedRootSignature");
|
||||
|
||||
if (FAILED(screen->dev->CreateFence(0, D3D12_FENCE_FLAG_NONE,
|
||||
__uuidof(ctx->cmdqueue_fence),
|
||||
(void **)&ctx->cmdqueue_fence))) {
|
||||
IID_PPV_ARGS(&ctx->cmdqueue_fence)))) {
|
||||
FREE(ctx);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -69,8 +69,7 @@ d3d12_descriptor_heap_new(ID3D12Device *dev,
|
||||
heap->desc.Type = type;
|
||||
heap->desc.Flags = flags;
|
||||
if (FAILED(dev->CreateDescriptorHeap(&heap->desc,
|
||||
__uuidof(heap->heap),
|
||||
(void **)&heap->heap))) {
|
||||
IID_PPV_ARGS(&heap->heap)))) {
|
||||
FREE(heap);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -68,16 +68,14 @@ choose_dxgi_adapter(IDXGIFactory4 *factory, LUID *adapter)
|
||||
IDXGIAdapter1 *ret;
|
||||
if (adapter) {
|
||||
if (SUCCEEDED(factory->EnumAdapterByLuid(*adapter,
|
||||
__uuidof(IDXGIAdapter1),
|
||||
(void**)&ret)))
|
||||
IID_PPV_ARGS(&ret))))
|
||||
return ret;
|
||||
debug_printf("D3D12: requested adapter missing, falling back to auto-detection...\n");
|
||||
}
|
||||
|
||||
bool want_warp = env_var_as_boolean("LIBGL_ALWAYS_SOFTWARE", false);
|
||||
if (want_warp) {
|
||||
if (SUCCEEDED(factory->EnumWarpAdapter(__uuidof(IDXGIAdapter1),
|
||||
(void**)&ret)))
|
||||
if (SUCCEEDED(factory->EnumWarpAdapter(IID_PPV_ARGS(&ret))))
|
||||
return ret;
|
||||
debug_printf("D3D12: failed to enum warp adapter\n");
|
||||
return NULL;
|
||||
|
||||
@@ -279,8 +279,7 @@ create_gfx_pipeline_state(struct d3d12_context *ctx)
|
||||
|
||||
ID3D12PipelineState *ret;
|
||||
if (FAILED(screen->dev->CreateGraphicsPipelineState(&pso_desc,
|
||||
__uuidof(ret),
|
||||
(void **)&ret))) {
|
||||
IID_PPV_ARGS(&ret)))) {
|
||||
debug_printf("D3D12: CreateGraphicsPipelineState failed!\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -138,8 +138,7 @@ d3d12_create_query(struct pipe_context *pctx,
|
||||
desc.Count = query->num_queries;
|
||||
desc.Type = d3d12_query_heap_type(query_type);
|
||||
if (FAILED(screen->dev->CreateQueryHeap(&desc,
|
||||
__uuidof(query->query_heap),
|
||||
(void **)&query->query_heap))) {
|
||||
IID_PPV_ARGS(&query->query_heap)))) {
|
||||
FREE(query);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -217,8 +217,7 @@ init_texture(struct d3d12_screen *screen,
|
||||
&desc,
|
||||
D3D12_RESOURCE_STATE_COMMON,
|
||||
NULL,
|
||||
__uuidof(ID3D12Resource),
|
||||
(void **)&d3d12_res);
|
||||
IID_PPV_ARGS(&d3d12_res));
|
||||
if (FAILED(hres))
|
||||
return false;
|
||||
|
||||
|
||||
@@ -169,8 +169,7 @@ create_root_signature(struct d3d12_context *ctx, struct d3d12_root_signature_key
|
||||
if (FAILED(screen->dev->CreateRootSignature(0,
|
||||
sig->GetBufferPointer(),
|
||||
sig->GetBufferSize(),
|
||||
__uuidof(ret),
|
||||
(void **)&ret))) {
|
||||
IID_PPV_ARGS(&ret)))) {
|
||||
debug_printf("CreateRootSignature failed\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -633,8 +633,7 @@ d3d12_flush_frontbuffer(struct pipe_screen * pscreen,
|
||||
}
|
||||
|
||||
ID3D12SharingContract *sharing_contract;
|
||||
if (SUCCEEDED(screen->cmdqueue->QueryInterface(__uuidof(sharing_contract),
|
||||
(void **)&sharing_contract)))
|
||||
if (SUCCEEDED(screen->cmdqueue->QueryInterface(IID_PPV_ARGS(&sharing_contract))))
|
||||
sharing_contract->Present(d3d12_res, 0, WindowFromDC((HDC)winsys_drawable_handle));
|
||||
|
||||
winsys->displaytarget_display(winsys, res->dt, winsys_drawable_handle, sub_box);
|
||||
@@ -659,7 +658,7 @@ get_debug_interface()
|
||||
}
|
||||
|
||||
ID3D12Debug *debug;
|
||||
if (FAILED(D3D12GetDebugInterface(__uuidof(ID3D12Debug), (void **)&debug))) {
|
||||
if (FAILED(D3D12GetDebugInterface(IID_PPV_ARGS(&debug)))) {
|
||||
debug_printf("D3D12: D3D12GetDebugInterface failed\n");
|
||||
return NULL;
|
||||
}
|
||||
@@ -681,7 +680,7 @@ enable_gpu_validation()
|
||||
ID3D12Debug *debug = get_debug_interface();
|
||||
ID3D12Debug3 *debug3;
|
||||
if (debug &&
|
||||
SUCCEEDED(debug->QueryInterface(__uuidof(debug), (void **)&debug3)))
|
||||
SUCCEEDED(debug->QueryInterface(IID_PPV_ARGS(&debug3))))
|
||||
debug3->SetEnableGPUBasedValidation(true);
|
||||
}
|
||||
|
||||
@@ -712,7 +711,7 @@ create_device(IUnknown *adapter)
|
||||
|
||||
ID3D12Device *dev;
|
||||
if (SUCCEEDED(D3D12CreateDevice(adapter, D3D_FEATURE_LEVEL_11_0,
|
||||
__uuidof(ID3D12Device), (void **)&dev)))
|
||||
IID_PPV_ARGS(&dev))))
|
||||
return dev;
|
||||
|
||||
debug_printf("D3D12: D3D12CreateDevice failed\n");
|
||||
@@ -764,8 +763,7 @@ d3d12_init_screen(struct d3d12_screen *screen, struct sw_winsys *winsys, IUnknow
|
||||
}
|
||||
|
||||
ID3D12InfoQueue *info_queue;
|
||||
if (SUCCEEDED(screen->dev->QueryInterface(__uuidof(info_queue),
|
||||
(void **)&info_queue))) {
|
||||
if (SUCCEEDED(screen->dev->QueryInterface(IID_PPV_ARGS(&info_queue)))) {
|
||||
D3D12_MESSAGE_SEVERITY severities[] = {
|
||||
D3D12_MESSAGE_SEVERITY_INFO,
|
||||
D3D12_MESSAGE_SEVERITY_WARNING,
|
||||
@@ -840,8 +838,7 @@ d3d12_init_screen(struct d3d12_screen *screen, struct sw_winsys *winsys, IUnknow
|
||||
queue_desc.Flags = D3D12_COMMAND_QUEUE_FLAG_NONE;
|
||||
queue_desc.NodeMask = 0;
|
||||
if (FAILED(screen->dev->CreateCommandQueue(&queue_desc,
|
||||
__uuidof(screen->cmdqueue),
|
||||
(void **)&screen->cmdqueue)))
|
||||
IID_PPV_ARGS(&screen->cmdqueue))))
|
||||
goto failed;
|
||||
|
||||
UINT64 timestamp_freq;
|
||||
|
||||
Reference in New Issue
Block a user