Path: blob/21.2-virgl/src/gallium/drivers/d3d12/d3d12_batch.h
4570 views
/*1* Copyright © Microsoft Corporation2*3* Permission is hereby granted, free of charge, to any person obtaining a4* copy of this software and associated documentation files (the "Software"),5* to deal in the Software without restriction, including without limitation6* the rights to use, copy, modify, merge, publish, distribute, sublicense,7* and/or sell copies of the Software, and to permit persons to whom the8* Software is furnished to do so, subject to the following conditions:9*10* The above copyright notice and this permission notice (including the next11* paragraph) shall be included in all copies or substantial portions of the12* Software.13*14* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR15* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,16* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL17* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER18* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING19* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS20* IN THE SOFTWARE.21*/2223#ifndef D3D12_BATCH_H24#define D3D12_BATCH_H2526#include "util/u_dynarray.h"27#include <stdint.h>2829#ifndef _WIN3230#include <wsl/winadapter.h>31#endif3233#define D3D12_IGNORE_SDK_LAYERS34#include <directx/d3d12.h>3536struct d3d12_bo;37struct d3d12_descriptor_heap;38struct d3d12_fence;3940struct d3d12_batch {41struct d3d12_fence *fence;4243struct set *bos;44struct set *sampler_views;45struct set *surfaces;46struct set *objects;4748struct util_dynarray zombie_samplers;4950ID3D12CommandAllocator *cmdalloc;51struct d3d12_descriptor_heap *sampler_heap;52struct d3d12_descriptor_heap *view_heap;53bool has_errors;54};5556bool57d3d12_init_batch(struct d3d12_context *ctx, struct d3d12_batch *batch);5859void60d3d12_destroy_batch(struct d3d12_context *ctx, struct d3d12_batch *batch);6162void63d3d12_start_batch(struct d3d12_context *ctx, struct d3d12_batch *batch);6465void66d3d12_end_batch(struct d3d12_context *ctx, struct d3d12_batch *batch);6768bool69d3d12_reset_batch(struct d3d12_context *ctx, struct d3d12_batch *batch, uint64_t timeout_ns);7071bool72d3d12_batch_has_references(struct d3d12_batch *batch,73struct d3d12_bo *bo);7475void76d3d12_batch_reference_resource(struct d3d12_batch *batch,77struct d3d12_resource *res);7879void80d3d12_batch_reference_sampler_view(struct d3d12_batch *batch,81struct d3d12_sampler_view *sv);8283void84d3d12_batch_reference_surface_texture(struct d3d12_batch *batch,85struct d3d12_surface *surf);8687void88d3d12_batch_reference_object(struct d3d12_batch *batch,89ID3D12Object *object);9091#endif929394