diff --git a/src/gallium/drivers/d3d12/d3d12_video_buffer.cpp b/src/gallium/drivers/d3d12/d3d12_video_buffer.cpp index b0e842534b3..4dba7572de1 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_buffer.cpp +++ b/src/gallium/drivers/d3d12/d3d12_video_buffer.cpp @@ -272,9 +272,6 @@ d3d12_video_buffer_get_surfaces(struct pipe_video_buffer *buffer) (pD3D12VideoBuffer->base.bind & PIPE_BIND_VIDEO_ENCODE_DPB)) return nullptr; - if (!pipe->create_surface) - return nullptr; - // pCurPlaneResource refers to the planar resource, not the overall resource. // in d3d12_resource this is handled by having a linked list of planes with // d3dRes->base.next ptr to next plane resource diff --git a/src/gallium/drivers/d3d12/d3d12_video_screen.cpp b/src/gallium/drivers/d3d12/d3d12_video_screen.cpp index c2a320d125c..61404defaa2 100644 --- a/src/gallium/drivers/d3d12/d3d12_video_screen.cpp +++ b/src/gallium/drivers/d3d12/d3d12_video_screen.cpp @@ -2818,6 +2818,23 @@ d3d12_screen_get_video_param(struct pipe_screen *pscreen, } else if (entrypoint == PIPE_VIDEO_ENTRYPOINT_PROCESSING) { return d3d12_screen_get_video_param_postproc(pscreen, profile, entrypoint, param); } + + // Some frontends call get_video_param with PIPE_VIDEO_ENTRYPOINT_UNKNOWN + // to get some capabilities not entrypoint specific. + switch (param) { + case PIPE_VIDEO_CAP_SKIP_CLEAR_SURFACE: + { + // D3D12 does not require clearing the surface on creation for video + // as it doesn't use D3D12_HEAP_FLAG_CREATE_NOT_ZEROED + // Furthermore, on PIPE_CONTEXT_MEDIA_ONLY contexts, the + // clear_render_target function is not implemented + return 1; + } break; + default: + debug_printf("[d3d12_screen_get_video_param] unknown video param: %d\n", param); + return 0; + } + return 0; }