unsigned dump)
{
unsigned r;
- struct radeon_llvm_binary binary;
+ struct radeon_shader_binary binary;
const char * gpu_family = r600_get_llvm_processor_name(family);
unsigned i;
- memset(&binary, 0, sizeof(struct radeon_llvm_binary));
+ memset(&binary, 0, sizeof(struct radeon_shader_binary));
r = radeon_llvm_compile(mod, &binary, gpu_family, dump);
assert(binary.code_size % 4 == 0);
struct r600_common_context;
+struct radeon_shader_binary {
+ /** Shader code */
+ unsigned char *code;
+ unsigned code_size;
+
+ /** Config/Context register state that accompanies this shader.
+ * This is a stream of dword pairs. First dword contains the
+ * register address, the second dword contains the value.*/
+ unsigned char *config;
+ unsigned config_size;
+
+ /** Set to 1 if the disassembly for this binary has been dumped to
+ * stderr. */
+ int disassembled;
+};
+
struct r600_resource {
struct u_resource b;
*
*/
#include "radeon_llvm_emit.h"
+#include "r600_pipe_common.h"
#include "util/u_memory.h"
#include <llvm-c/Target.h>
*
* @returns 0 for success, 1 for failure
*/
-unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_llvm_binary *binary,
+unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_shader_binary *binary,
const char * gpu_family, unsigned dump) {
LLVMTargetRef target;
#include <llvm-c/Core.h>
-struct radeon_llvm_binary {
- unsigned char *code;
- unsigned code_size;
- unsigned char *config;
- unsigned config_size;
- int disassembled;
-};
+struct radeon_shader_binary;
void radeon_llvm_shader_type(LLVMValueRef F, unsigned type);
unsigned radeon_llvm_compile(
LLVMModuleRef M,
- struct radeon_llvm_binary *binary,
+ struct radeon_shader_binary *binary,
const char * gpu_family,
unsigned dump);
{
unsigned i;
uint32_t *ptr;
- struct radeon_llvm_binary binary;
+ struct radeon_shader_binary binary;
bool dump = r600_can_dump_shader(&sctx->screen->b,
shader->selector ? shader->selector->tokens : NULL);
memset(&binary, 0, sizeof(binary));