19f464c52Smaya/*
29f464c52Smaya * Copyright (c) 2019 Etnaviv Project
39f464c52Smaya * Copyright (C) 2019 Zodiac Inflight Innovations
49f464c52Smaya *
59f464c52Smaya * Permission is hereby granted, free of charge, to any person obtaining a
69f464c52Smaya * copy of this software and associated documentation files (the "Software"),
79f464c52Smaya * to deal in the Software without restriction, including without limitation
89f464c52Smaya * the rights to use, copy, modify, merge, publish, distribute, sub license,
99f464c52Smaya * and/or sell copies of the Software, and to permit persons to whom the
109f464c52Smaya * Software is furnished to do so, subject to the following conditions:
119f464c52Smaya *
129f464c52Smaya * The above copyright notice and this permission notice (including the
139f464c52Smaya * next paragraph) shall be included in all copies or substantial portions
149f464c52Smaya * of the Software.
159f464c52Smaya *
169f464c52Smaya * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
179f464c52Smaya * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
189f464c52Smaya * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
199f464c52Smaya * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
209f464c52Smaya * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
219f464c52Smaya * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
229f464c52Smaya * DEALINGS IN THE SOFTWARE.
239f464c52Smaya *
249f464c52Smaya * Authors:
259f464c52Smaya *    Christian Gmeiner <christian.gmeiner@gmail.com>
269f464c52Smaya */
279f464c52Smaya
289f464c52Smaya#ifndef H_ETNA_ETC2
299f464c52Smaya#define H_ETNA_ETC2
309f464c52Smaya
319f464c52Smaya#include <stdbool.h>
329f464c52Smaya#include <stdint.h>
339f464c52Smaya
349f464c52Smaya#include "pipe/p_format.h"
359f464c52Smaya#include "util/u_dynarray.h"
369f464c52Smaya
379f464c52Smayastruct pipe_resource;
389f464c52Smaya
399f464c52Smayabool
409f464c52Smayaetna_etc2_needs_patching(const struct pipe_resource *prsc);
419f464c52Smaya
429f464c52Smayavoid
439f464c52Smayaetna_etc2_calculate_blocks(uint8_t *buffer, unsigned stride,
449f464c52Smaya                           unsigned width, unsigned height,
459f464c52Smaya                           enum pipe_format format,
469f464c52Smaya                           struct util_dynarray *offsets);
479f464c52Smaya
489f464c52Smayavoid
499f464c52Smayaetna_etc2_patch(uint8_t *buffer, const struct util_dynarray *offsets);
509f464c52Smaya
519f464c52Smaya#endif
52