Texture Instruction - Fixed Color
This commit is contained in:
@@ -10,7 +10,7 @@ CFLAGS += -I./include -I../hw
|
||||
|
||||
PROJECT = libvortexrt
|
||||
|
||||
SRCS = ./src/vx_start.S ./src/vx_print.S ./src/vx_print.c ./src/vx_spawn.c
|
||||
SRCS = ./src/vx_start.S ./src/vx_print.S ./src/vx_print.c ./src/vx_spawn.c ./src/vx_tex.c
|
||||
|
||||
OBJS := $(addsuffix .o, $(notdir $(SRCS)))
|
||||
|
||||
|
||||
@@ -109,6 +109,14 @@ inline int vx_num_instrs() {
|
||||
return result;
|
||||
}
|
||||
|
||||
// Texture load instruction
|
||||
inline int vx_tex_ld(unsigned t, unsigned u, unsigned v, unsigned lod_t) {
|
||||
lod_t = (lod_t << 8) | t;
|
||||
int result;
|
||||
asm volatile (".insn r4 0x6b, 5, 1, %0, %1, %2, %3" :: "r"(result), "r"(u), "r"(v), "r"(lod_t));
|
||||
return result;
|
||||
}
|
||||
|
||||
#define __if(b) vx_split(b); \
|
||||
if (b)
|
||||
|
||||
|
||||
17
runtime/include/vx_tex.h
Normal file
17
runtime/include/vx_tex.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef VX_API_H
|
||||
#define VX_API_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
int vx_tex(unsigned t, unsigned u, unsigned v, unsigned lod);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
BIN
runtime/libvortexrt.a
Normal file
BIN
runtime/libvortexrt.a
Normal file
Binary file not shown.
1073
runtime/libvortexrt.dump
Normal file
1073
runtime/libvortexrt.dump
Normal file
File diff suppressed because it is too large
Load Diff
9
runtime/src/vx_tex.S
Normal file
9
runtime/src/vx_tex.S
Normal file
@@ -0,0 +1,9 @@
|
||||
#include <VX_config.h>
|
||||
|
||||
@ .type vx_tex_ld, @function
|
||||
@ .global vx_tex_ld
|
||||
@ vx_tex_ld:
|
||||
@ slli a1,a1,0x8
|
||||
@ or a1,a1,a0
|
||||
@ .word 0x5ae7952b
|
||||
@ ret
|
||||
13
runtime/src/vx_tex.c
Normal file
13
runtime/src/vx_tex.c
Normal file
@@ -0,0 +1,13 @@
|
||||
#include <vx_tex.h>
|
||||
#include <vx_intrinsics.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define NUM_CORES_MAX 32
|
||||
|
||||
int vx_tex(unsigned t, unsigned u, unsigned v, unsigned lod){
|
||||
return vx_tex_ld(t,u,v,lod);
|
||||
}
|
||||
BIN
runtime/vx_print.S.o
Normal file
BIN
runtime/vx_print.S.o
Normal file
Binary file not shown.
BIN
runtime/vx_print.c.o
Normal file
BIN
runtime/vx_print.c.o
Normal file
Binary file not shown.
BIN
runtime/vx_spawn.c.o
Normal file
BIN
runtime/vx_spawn.c.o
Normal file
Binary file not shown.
BIN
runtime/vx_start.S.o
Normal file
BIN
runtime/vx_start.S.o
Normal file
Binary file not shown.
BIN
runtime/vx_tex.c.o
Normal file
BIN
runtime/vx_tex.c.o
Normal file
Binary file not shown.
Reference in New Issue
Block a user