19f464c52Smaya/*
29f464c52Smaya * Copyright © 2018 Intel Corporation
39f464c52Smaya *
49f464c52Smaya * Permission is hereby granted, free of charge, to any person obtaining a
59f464c52Smaya * copy of this software and associated documentation files (the "Software"),
69f464c52Smaya * to deal in the Software without restriction, including without limitation
79f464c52Smaya * the rights to use, copy, modify, merge, publish, distribute, sublicense,
89f464c52Smaya * and/or sell copies of the Software, and to permit persons to whom the
99f464c52Smaya * Software is furnished to do so, subject to the following conditions:
109f464c52Smaya *
119f464c52Smaya * The above copyright notice and this permission notice (including the next
129f464c52Smaya * paragraph) shall be included in all copies or substantial portions of the
139f464c52Smaya * Software.
149f464c52Smaya *
159f464c52Smaya * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
169f464c52Smaya * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
179f464c52Smaya * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
189f464c52Smaya * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
199f464c52Smaya * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
209f464c52Smaya * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
219f464c52Smaya * IN THE SOFTWARE.
229f464c52Smaya */
239f464c52Smaya
249f464c52Smaya#ifndef IRIS_BINDER_DOT_H
259f464c52Smaya#define IRIS_BINDER_DOT_H
269f464c52Smaya
279f464c52Smaya#include <stdint.h>
289f464c52Smaya#include <stdbool.h>
299f464c52Smaya#include "compiler/shader_enums.h"
309f464c52Smaya
319f464c52Smayastruct iris_bo;
329f464c52Smayastruct iris_batch;
339f464c52Smayastruct iris_bufmgr;
349f464c52Smayastruct iris_compiled_shader;
359f464c52Smayastruct iris_context;
369f464c52Smaya
379f464c52Smayastruct iris_binder
389f464c52Smaya{
399f464c52Smaya   struct iris_bo *bo;
409f464c52Smaya   void *map;
419f464c52Smaya
429f464c52Smaya   /** Insert new entries at this offset (in bytes) */
439f464c52Smaya   uint32_t insert_point;
449f464c52Smaya
459f464c52Smaya   /**
469f464c52Smaya    * Last assigned offset for each shader stage's binding table.
479f464c52Smaya    * Zero is considered invalid and means there's no binding table.
489f464c52Smaya    */
499f464c52Smaya   uint32_t bt_offset[MESA_SHADER_STAGES];
509f464c52Smaya};
519f464c52Smaya
529f464c52Smayavoid iris_init_binder(struct iris_context *ice);
539f464c52Smayavoid iris_destroy_binder(struct iris_binder *binder);
549f464c52Smayauint32_t iris_binder_reserve(struct iris_context *ice, unsigned size);
559f464c52Smayavoid iris_binder_reserve_3d(struct iris_context *ice);
569f464c52Smayavoid iris_binder_reserve_compute(struct iris_context *ice);
579f464c52Smaya
589f464c52Smaya#endif
59