Path: blob/21.2-virgl/src/gallium/drivers/r600/evergreen_compute_internal.h
4570 views
/*1* Permission is hereby granted, free of charge, to any person obtaining a2* copy of this software and associated documentation files (the "Software"),3* to deal in the Software without restriction, including without limitation4* on the rights to use, copy, modify, merge, publish, distribute, sub5* license, and/or sell copies of the Software, and to permit persons to whom6* the Software is furnished to do so, subject to the following conditions:7*8* The above copyright notice and this permission notice (including the next9* paragraph) shall be included in all copies or substantial portions of the10* Software.11*12* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR13* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,14* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL15* THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,16* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR17* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE18* USE OR OTHER DEALINGS IN THE SOFTWARE.19*20* Authors:21* Adam Rak <[email protected]>22*/23#ifndef EVERGREEN_COMPUTE_INTERNAL_H24#define EVERGREEN_COMPUTE_INTERNAL_H2526#include "ac_binary.h"27#include "r600_asm.h"28#ifdef HAVE_OPENCL29#include <llvm-c/Core.h>30#endif3132struct r600_shader_reloc {33char name[32];34uint64_t offset;35};3637struct r600_shader_binary {38unsigned code_size;39unsigned config_size;40/** The number of bytes of config information for each global symbol.41*/42unsigned config_size_per_symbol;43unsigned rodata_size;44unsigned global_symbol_count;45unsigned reloc_count;4647/** Shader code */48unsigned char *code;4950/** Config/Context register state that accompanies this shader.51* This is a stream of dword pairs. First dword contains the52* register address, the second dword contains the value.*/53unsigned char *config;545556/** Constant data accessed by the shader. This will be uploaded57* into a constant buffer. */58unsigned char *rodata;5960/** List of symbol offsets for the shader */61uint64_t *global_symbol_offsets;6263struct r600_shader_reloc *relocs;6465/** Disassembled shader in a string. */66char *disasm_string;67};6869struct r600_pipe_compute {70struct r600_context *ctx;7172struct r600_shader_binary binary;7374enum pipe_shader_ir ir_type;7576/* tgsi selector */77struct r600_pipe_shader_selector *sel;7879struct r600_resource *code_bo;80struct r600_bytecode bc;8182unsigned local_size;83unsigned private_size;84unsigned input_size;85struct r600_resource *kernel_param;8687#ifdef HAVE_OPENCL88LLVMContextRef llvm_ctx;89#endif90};9192struct r600_resource* r600_compute_buffer_alloc_vram(struct r600_screen *screen, unsigned size);9394#endif959697