Merge remote branch 'origin/master' into pipe-video
Conflicts: src/gallium/drivers/r600/r600_asm.c
This commit is contained in:
@@ -15,6 +15,7 @@ ASM_FLAGS = @ASM_FLAGS@
|
||||
PIC_FLAGS = @PIC_FLAGS@
|
||||
DEFINES = @DEFINES@
|
||||
API_DEFINES = @API_DEFINES@
|
||||
SHARED_GLAPI = @SHARED_GLAPI@
|
||||
CFLAGS = @CPPFLAGS@ @CFLAGS@ \
|
||||
$(OPT_FLAGS) $(PIC_FLAGS) $(ARCH_FLAGS) $(ASM_FLAGS) $(DEFINES)
|
||||
CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@ \
|
||||
@@ -65,6 +66,7 @@ OSMESA_LIB = @OSMESA_LIB@
|
||||
GLESv1_CM_LIB = GLESv1_CM
|
||||
GLESv2_LIB = GLESv2
|
||||
VG_LIB = OpenVG
|
||||
GLAPI_LIB = glapi
|
||||
|
||||
# Library names (actual file names)
|
||||
GL_LIB_NAME = @GL_LIB_NAME@
|
||||
@@ -76,6 +78,7 @@ EGL_LIB_NAME = @EGL_LIB_NAME@
|
||||
GLESv1_CM_LIB_NAME = @GLESv1_CM_LIB_NAME@
|
||||
GLESv2_LIB_NAME = @GLESv2_LIB_NAME@
|
||||
VG_LIB_NAME = @VG_LIB_NAME@
|
||||
GLAPI_LIB_NAME = @GLAPI_LIB_NAME@
|
||||
|
||||
# Globs used to install the lib and all symlinks
|
||||
GL_LIB_GLOB = @GL_LIB_GLOB@
|
||||
@@ -87,6 +90,7 @@ EGL_LIB_GLOB = @EGL_LIB_GLOB@
|
||||
GLESv1_CM_LIB_GLOB = @GLESv1_CM_LIB_GLOB@
|
||||
GLESv2_LIB_GLOB = @GLESv2_LIB_GLOB@
|
||||
VG_LIB_GLOB = @VG_LIB_GLOB@
|
||||
GLAPI_LIB_GLOB = @GLAPI_LIB_GLOB@
|
||||
|
||||
# Directories to build
|
||||
LIB_DIR = @LIB_DIR@
|
||||
@@ -129,6 +133,7 @@ APP_LIB_DEPS = $(EXTRA_LIB_PATH) @APP_LIB_DEPS@
|
||||
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv1_CM_LIB_DEPS@
|
||||
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) @GLESv2_LIB_DEPS@
|
||||
VG_LIB_DEPS = $(EXTRA_LIB_PATH) @VG_LIB_DEPS@
|
||||
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) @GLAPI_LIB_DEPS@
|
||||
|
||||
# DRI dependencies
|
||||
DRI_LIB_DEPS = $(EXTRA_LIB_PATH) @DRI_LIB_DEPS@
|
||||
|
||||
@@ -59,6 +59,7 @@ EGL_LIB = EGL
|
||||
GLESv1_CM_LIB = GLESv1_CM
|
||||
GLESv2_LIB = GLESv2
|
||||
VG_LIB = OpenVG
|
||||
GLAPI_LIB = glapi
|
||||
|
||||
|
||||
# Library names (actual file names)
|
||||
@@ -71,6 +72,7 @@ EGL_LIB_NAME = lib$(EGL_LIB).so
|
||||
GLESv1_CM_LIB_NAME = lib$(GLESv1_CM_LIB).so
|
||||
GLESv2_LIB_NAME = lib$(GLESv2_LIB).so
|
||||
VG_LIB_NAME = lib$(VG_LIB).so
|
||||
GLAPI_LIB_NAME = lib$(GLAPI_LIB).so
|
||||
|
||||
# globs used to install the lib and all symlinks
|
||||
GL_LIB_GLOB = $(GL_LIB_NAME)*
|
||||
@@ -82,6 +84,7 @@ EGL_LIB_GLOB = $(EGL_LIB_NAME)*
|
||||
GLESv1_CM_LIB_GLOB = $(GLESv1_CM_LIB_NAME)*
|
||||
GLESv2_LIB_GLOB = $(GLESv2_LIB_NAME)*
|
||||
VG_LIB_GLOB = $(VG_LIB_NAME)*
|
||||
GLAPI_LIB_GLOB = $(GLAPI_LIB_NAME)*
|
||||
|
||||
TALLOC_LIBS = `pkg-config --libs talloc`
|
||||
TALLOC_CFLAGS = `pkg-config --cflags talloc`
|
||||
@@ -130,6 +133,7 @@ APP_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LI
|
||||
GLESv1_CM_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
|
||||
GLESv2_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
|
||||
VG_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
|
||||
GLAPI_LIB_DEPS = $(EXTRA_LIB_PATH) -lpthread
|
||||
|
||||
# Program dependencies - specific GL/glut libraries added in Makefiles
|
||||
APP_LIB_DEPS = -lm
|
||||
|
||||
@@ -316,6 +316,7 @@ EGL_LIB_NAME='lib$(EGL_LIB).'${LIB_EXTENSION}
|
||||
GLESv1_CM_LIB_NAME='lib$(GLESv1_CM_LIB).'${LIB_EXTENSION}
|
||||
GLESv2_LIB_NAME='lib$(GLESv2_LIB).'${LIB_EXTENSION}
|
||||
VG_LIB_NAME='lib$(VG_LIB).'${LIB_EXTENSION}
|
||||
GLAPI_LIB_NAME='lib$(GLAPI_LIB).'${LIB_EXTENSION}
|
||||
|
||||
GL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
|
||||
GLU_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLU_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
|
||||
@@ -327,6 +328,7 @@ EGL_LIB_GLOB=${LIB_PREFIX_GLOB}'$(EGL_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTE
|
||||
GLESv1_CM_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv1_CM_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
|
||||
GLESv2_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLESv2_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
|
||||
VG_LIB_GLOB=${LIB_PREFIX_GLOB}'$(VG_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
|
||||
GLAPI_LIB_GLOB=${LIB_PREFIX_GLOB}'$(GLAPI_LIB)'${LIB_VERSION_SEPARATOR}'*'${LIB_EXTENSION}'*'
|
||||
|
||||
AC_SUBST([GL_LIB_NAME])
|
||||
AC_SUBST([GLU_LIB_NAME])
|
||||
@@ -337,6 +339,7 @@ AC_SUBST([EGL_LIB_NAME])
|
||||
AC_SUBST([GLESv1_CM_LIB_NAME])
|
||||
AC_SUBST([GLESv2_LIB_NAME])
|
||||
AC_SUBST([VG_LIB_NAME])
|
||||
AC_SUBST([GLAPI_LIB_NAME])
|
||||
|
||||
AC_SUBST([GL_LIB_GLOB])
|
||||
AC_SUBST([GLU_LIB_GLOB])
|
||||
@@ -347,6 +350,7 @@ AC_SUBST([EGL_LIB_GLOB])
|
||||
AC_SUBST([GLESv1_CM_LIB_GLOB])
|
||||
AC_SUBST([GLESv2_LIB_GLOB])
|
||||
AC_SUBST([VG_LIB_GLOB])
|
||||
AC_SUBST([GLAPI_LIB_GLOB])
|
||||
|
||||
dnl
|
||||
dnl Arch/platform-specific settings
|
||||
@@ -524,6 +528,18 @@ if test "x$enable_gles2" = xyes; then
|
||||
fi
|
||||
AC_SUBST([API_DEFINES])
|
||||
|
||||
AC_ARG_ENABLE([shared-glapi],
|
||||
[AS_HELP_STRING([--enable-shared-glapi],
|
||||
[EXPERIMENTAL. Enable shared glapi for OpenGL @<:@default=no@:>@])],
|
||||
[enable_shared_glapi="$enableval"],
|
||||
[enable_shared_glapi=no])
|
||||
|
||||
SHARED_GLAPI="0"
|
||||
if test "x$enable_shared_glapi" = xyes; then
|
||||
SHARED_GLAPI="1"
|
||||
fi
|
||||
AC_SUBST([SHARED_GLAPI])
|
||||
|
||||
dnl
|
||||
dnl Driver configuration. Options are xlib, dri and osmesa right now.
|
||||
dnl More later: fbdev, ...
|
||||
@@ -585,6 +601,13 @@ GALLIUM_WINSYS_DIRS="sw"
|
||||
GALLIUM_DRIVERS_DIRS="softpipe failover galahad trace rbug noop identity"
|
||||
GALLIUM_STATE_TRACKERS_DIRS=""
|
||||
|
||||
# build shared-glapi if enabled for OpenGL or if OpenGL ES is enabled
|
||||
case "x$enabled_shared_glapi$enable_gles1$enable_gles2" in
|
||||
x*yes*)
|
||||
CORE_DIRS="$CORE_DIRS mapi/shared-glapi"
|
||||
;;
|
||||
esac
|
||||
|
||||
# build glapi if OpenGL is enabled
|
||||
if test "x$enable_opengl" = xyes; then
|
||||
CORE_DIRS="$CORE_DIRS mapi/glapi"
|
||||
@@ -792,6 +815,8 @@ AC_SUBST([GLESv1_CM_PC_LIB_PRIV])
|
||||
AC_SUBST([GLESv2_LIB_DEPS])
|
||||
AC_SUBST([GLESv2_PC_LIB_PRIV])
|
||||
|
||||
GLAPI_LIB_DEPS="-lpthread"
|
||||
AC_SUBST([GLAPI_LIB_DEPS])
|
||||
|
||||
AC_SUBST([HAVE_XF86VIDMODE])
|
||||
|
||||
@@ -1428,6 +1453,7 @@ yes)
|
||||
if test "x$enable_openvg" != xyes; then
|
||||
AC_MSG_ERROR([cannot build vega state tracker without --enable-openvg])
|
||||
fi
|
||||
have_st_vega="yes"
|
||||
;;
|
||||
xorg/xvmc)
|
||||
# Check for xvmc?
|
||||
@@ -1463,6 +1489,14 @@ yes)
|
||||
fi
|
||||
done
|
||||
GALLIUM_STATE_TRACKERS_DIRS="$state_trackers"
|
||||
|
||||
# append --enable-openvg/--enable-gallium-egl to --with-state-trackers
|
||||
if test "x$have_st_vega" != xyes -a "x$enable_openvg" = xyes; then
|
||||
AC_MSG_ERROR([--with-state-trackers specified but vega is missing])
|
||||
fi
|
||||
if test "x$HAVE_ST_EGL" != xyes -a "x$enable_gallium_egl" = xyes; then
|
||||
AC_MSG_ERROR([--with-state-trackers specified but egl is missing])
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ core
|
||||
core_subset
|
||||
gallium
|
||||
glapi
|
||||
glsl
|
||||
main
|
||||
math
|
||||
math_subset
|
||||
|
||||
@@ -11,6 +11,7 @@ FULL = \
|
||||
math.doxy \
|
||||
vbo.doxy \
|
||||
glapi.doxy \
|
||||
glsl.doxy \
|
||||
shader.doxy \
|
||||
swrast.doxy \
|
||||
swrast_setup.doxy \
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
# Doxyfile 0.1
|
||||
|
||||
@INCLUDE = common.doxy
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# General configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME = "Mesa GLSL module"
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = ../src/glsl/
|
||||
RECURSIVE = NO
|
||||
EXCLUDE = ../src/glsl/glsl_lexer.cpp \
|
||||
../src/glsl/glsl_lexer.h \
|
||||
../src/glsl/glsl_parser.cpp \
|
||||
../src/glsl/glsl_parser.h
|
||||
EXCLUDE_PATTERNS =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
HTML_OUTPUT = glsl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH =
|
||||
INCLUDE_FILE_PATTERNS =
|
||||
PREDEFINED =
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::addtions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE = glsl.tag
|
||||
@@ -7,6 +7,7 @@
|
||||
<div class="qindex">
|
||||
<a class="qindex" href="../main/index.html">core</a> |
|
||||
<a class="qindex" href="../glapi/index.html">glapi</a> |
|
||||
<a class="qindex" href="../glsl/index.html">glsl</a> |
|
||||
<a class="qindex" href="../vbo/index.html">vbo</a> |
|
||||
<a class="qindex" href="../math/index.html">math</a> |
|
||||
<a class="qindex" href="../shader/index.html">shader</a> |
|
||||
|
||||
@@ -232,9 +232,11 @@ The most common type of query is the occlusion query,
|
||||
``PIPE_QUERY_OCCLUSION_COUNTER``, which counts the number of fragments which
|
||||
are written to the framebuffer without being culled by
|
||||
:ref:`Depth, Stencil, & Alpha` testing or shader KILL instructions.
|
||||
The result is an unsigned 64-bit integer.
|
||||
|
||||
Another type of query, ``PIPE_QUERY_TIME_ELAPSED``, returns the amount of
|
||||
time, in nanoseconds, the context takes to perform operations.
|
||||
The result is an unsigned 64-bit integer.
|
||||
|
||||
Gallium does not guarantee the availability of any query types; one must
|
||||
always check the capabilities of the :ref:`Screen` first.
|
||||
|
||||
@@ -151,7 +151,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
|
||||
case PIPE_CAP_INDEP_BLEND_ENABLE:
|
||||
return 1;
|
||||
case PIPE_CAP_INDEP_BLEND_FUNC:
|
||||
return 0;
|
||||
return 1;
|
||||
case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
|
||||
case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
|
||||
return 1;
|
||||
|
||||
@@ -1064,6 +1064,8 @@ lp_setup_begin_query(struct lp_setup_context *setup,
|
||||
{
|
||||
/* init the query to its beginning state */
|
||||
assert(setup->active_query == NULL);
|
||||
|
||||
set_scene_state(setup, SETUP_ACTIVE, "begin_query");
|
||||
|
||||
if (setup->scene) {
|
||||
if (!lp_scene_bin_everywhere(setup->scene,
|
||||
@@ -1093,6 +1095,8 @@ lp_setup_end_query(struct lp_setup_context *setup, struct llvmpipe_query *pq)
|
||||
{
|
||||
union lp_rast_cmd_arg dummy = { 0 };
|
||||
|
||||
set_scene_state(setup, SETUP_ACTIVE, "end_query");
|
||||
|
||||
assert(setup->active_query == pq);
|
||||
setup->active_query = NULL;
|
||||
|
||||
|
||||
@@ -546,6 +546,7 @@ generate_fragment(struct llvmpipe_context *lp,
|
||||
unsigned i;
|
||||
unsigned chan;
|
||||
unsigned cbuf;
|
||||
boolean cbuf0_write_all;
|
||||
|
||||
/* Adjust color input interpolation according to flatshade state:
|
||||
*/
|
||||
@@ -559,6 +560,15 @@ generate_fragment(struct llvmpipe_context *lp,
|
||||
}
|
||||
}
|
||||
|
||||
/* check if writes to cbuf[0] are to be copied to all cbufs */
|
||||
cbuf0_write_all = FALSE;
|
||||
for (i = 0;i < shader->info.base.num_properties; i++) {
|
||||
if (shader->info.base.properties[i].name ==
|
||||
TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS) {
|
||||
cbuf0_write_all = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO: actually pick these based on the fs and color buffer
|
||||
* characteristics. */
|
||||
@@ -697,9 +707,10 @@ generate_fragment(struct llvmpipe_context *lp,
|
||||
mask_input,
|
||||
counter);
|
||||
|
||||
for(cbuf = 0; cbuf < key->nr_cbufs; cbuf++)
|
||||
for(chan = 0; chan < NUM_CHANNELS; ++chan)
|
||||
fs_out_color[cbuf][chan][i] = out_color[cbuf][chan];
|
||||
for (cbuf = 0; cbuf < key->nr_cbufs; cbuf++)
|
||||
for (chan = 0; chan < NUM_CHANNELS; ++chan)
|
||||
fs_out_color[cbuf][chan][i] =
|
||||
out_color[cbuf * !cbuf0_write_all][chan];
|
||||
}
|
||||
|
||||
sampler->destroy(sampler);
|
||||
|
||||
@@ -4,6 +4,7 @@ include $(TOP)/configs/current
|
||||
LIBNAME = nouveau
|
||||
|
||||
LIBRARY_INCLUDES = \
|
||||
$(LIBDRM_CFLAGS) \
|
||||
-I$(TOP)/src/gallium/drivers/nouveau/include
|
||||
|
||||
C_SOURCES = nouveau_screen.c
|
||||
|
||||
@@ -29,4 +29,7 @@ C_SOURCES = \
|
||||
nv50_pc_optimize.c \
|
||||
nv50_pc_regalloc.c
|
||||
|
||||
LIBRARY_INCLUDES = \
|
||||
$(LIBDRM_CFLAGS)
|
||||
|
||||
include ../../Makefile.template
|
||||
|
||||
@@ -31,4 +31,7 @@ C_SOURCES = \
|
||||
nvc0_mm.c \
|
||||
nvc0_query.c
|
||||
|
||||
LIBRARY_INCLUDES = \
|
||||
$(LIBDRM_CFLAGS)
|
||||
|
||||
include ../../Makefile.template
|
||||
|
||||
@@ -843,7 +843,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#define NVC0_3D_VERTEX_BEGIN_GL_PRIMITIVE_TRIANGLES_ADJACENCY 0x0000000c
|
||||
#define NVC0_3D_VERTEX_BEGIN_GL_PRIMITIVE_TRIANGLE_STRIP_ADJACENCY 0x0000000d
|
||||
#define NVC0_3D_VERTEX_BEGIN_GL_PRIMITIVE_PATCHES 0x0000000e
|
||||
#define NVC0_3D_VERTEX_BEGIN_GL_INSTANCE_NEXT 0x10000000
|
||||
#define NVC0_3D_VERTEX_BEGIN_GL_INSTANCE_NEXT 0x04000000
|
||||
#define NVC0_3D_VERTEX_BEGIN_GL_INSTANCE_CONT 0x08000000
|
||||
|
||||
#define NVC0_3D_VERTEX_DATA 0x00001640
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ struct nvc0_context {
|
||||
uint32_t dirty;
|
||||
|
||||
struct {
|
||||
uint32_t instance_bits;
|
||||
uint32_t instance_elts; /* bitmask of per-instance elements */
|
||||
uint32_t instance_base;
|
||||
int32_t index_bias;
|
||||
boolean prim_restart;
|
||||
|
||||
@@ -132,15 +132,17 @@ nvc0_indirect_outputs(struct nvc0_translation_info *ti, int id)
|
||||
}
|
||||
|
||||
static INLINE unsigned
|
||||
nvc0_system_value_location(unsigned sn, unsigned si)
|
||||
nvc0_system_value_location(unsigned sn, unsigned si, boolean *is_input)
|
||||
{
|
||||
/* NOTE: locations 0xfxx indicate special regs */
|
||||
switch (sn) {
|
||||
/*
|
||||
case TGSI_SEMANTIC_VERTEXID:
|
||||
*is_input = TRUE;
|
||||
return 0x2fc;
|
||||
*/
|
||||
case TGSI_SEMANTIC_PRIMID:
|
||||
*is_input = TRUE;
|
||||
return 0x60;
|
||||
/*
|
||||
case TGSI_SEMANTIC_LAYER_INDEX:
|
||||
@@ -149,8 +151,10 @@ nvc0_system_value_location(unsigned sn, unsigned si)
|
||||
return 0x68;
|
||||
*/
|
||||
case TGSI_SEMANTIC_INSTANCEID:
|
||||
*is_input = TRUE;
|
||||
return 0x2f8;
|
||||
case TGSI_SEMANTIC_FACE:
|
||||
*is_input = TRUE;
|
||||
return 0x3fc;
|
||||
/*
|
||||
case TGSI_SEMANTIC_INVOCATIONID:
|
||||
@@ -281,7 +285,7 @@ prog_decl(struct nvc0_translation_info *ti,
|
||||
}
|
||||
break;
|
||||
case TGSI_FILE_SYSTEM_VALUE:
|
||||
ti->sysval_loc[i] = nvc0_system_value_location(sn, si);
|
||||
ti->sysval_loc[i] = nvc0_system_value_location(sn, si, &ti->sysval_in[i]);
|
||||
assert(first == last);
|
||||
break;
|
||||
case TGSI_FILE_NULL:
|
||||
@@ -414,6 +418,12 @@ nvc0_vp_gp_gen_header(struct nvc0_program *vp, struct nvc0_translation_info *ti)
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < TGSI_SEMANTIC_COUNT; ++i) {
|
||||
a = ti->sysval_loc[i] / 4;
|
||||
if (a > 0 && a < (0xf00 / 4))
|
||||
vp->hdr[(ti->sysval_in[i] ? 5 : 13) + a / 32] |= 1 << (a % 32);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -520,6 +530,12 @@ nvc0_fp_gen_header(struct nvc0_program *fp, struct nvc0_translation_info *ti)
|
||||
fp->hdr[18] |= 0xf << ti->output_loc[i][0];
|
||||
}
|
||||
|
||||
for (i = 0; i < TGSI_SEMANTIC_COUNT; ++i) {
|
||||
a = ti->sysval_loc[i] / 2;
|
||||
if ((a > 0) && (a < 0xf00 / 2))
|
||||
fp->hdr[4 + a / 32] |= NVC0_INTERP_FLAT << (a % 32);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ struct nvc0_translation_info {
|
||||
uint16_t input_loc[PIPE_MAX_SHADER_INPUTS][4];
|
||||
uint16_t output_loc[PIPE_MAX_SHADER_OUTPUTS][4];
|
||||
uint16_t sysval_loc[TGSI_SEMANTIC_COUNT];
|
||||
boolean sysval_in[TGSI_SEMANTIC_COUNT];
|
||||
int input_access[PIPE_MAX_SHADER_INPUTS][4];
|
||||
int output_access[PIPE_MAX_SHADER_OUTPUTS][4];
|
||||
ubyte interp_mode[PIPE_MAX_SHADER_INPUTS];
|
||||
|
||||
@@ -26,6 +26,7 @@ struct push_context {
|
||||
boolean primitive_restart;
|
||||
uint32_t prim;
|
||||
uint32_t restart_index;
|
||||
uint32_t instance_id;
|
||||
};
|
||||
|
||||
static INLINE unsigned
|
||||
@@ -75,7 +76,8 @@ emit_vertices_i08(struct push_context *ctx, unsigned start, unsigned count)
|
||||
|
||||
BEGIN_RING_NI(ctx->chan, RING_3D(VERTEX_DATA), size);
|
||||
|
||||
ctx->translate->run_elts8(ctx->translate, elts, nr, 0, ctx->chan->cur);
|
||||
ctx->translate->run_elts8(ctx->translate, elts, nr, ctx->instance_id,
|
||||
ctx->chan->cur);
|
||||
|
||||
ctx->chan->cur += size;
|
||||
count -= nr;
|
||||
@@ -86,7 +88,8 @@ emit_vertices_i08(struct push_context *ctx, unsigned start, unsigned count)
|
||||
elts++;
|
||||
BEGIN_RING(ctx->chan, RING_3D(VERTEX_END_GL), 2);
|
||||
OUT_RING (ctx->chan, 0);
|
||||
OUT_RING (ctx->chan, ctx->prim);
|
||||
OUT_RING (ctx->chan, NVC0_3D_VERTEX_BEGIN_GL_INSTANCE_CONT |
|
||||
(ctx->prim & ~NVC0_3D_VERTEX_BEGIN_GL_INSTANCE_NEXT));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,7 +111,8 @@ emit_vertices_i16(struct push_context *ctx, unsigned start, unsigned count)
|
||||
|
||||
BEGIN_RING_NI(ctx->chan, RING_3D(VERTEX_DATA), size);
|
||||
|
||||
ctx->translate->run_elts16(ctx->translate, elts, nr, 0, ctx->chan->cur);
|
||||
ctx->translate->run_elts16(ctx->translate, elts, nr, ctx->instance_id,
|
||||
ctx->chan->cur);
|
||||
|
||||
ctx->chan->cur += size;
|
||||
count -= nr;
|
||||
@@ -119,7 +123,8 @@ emit_vertices_i16(struct push_context *ctx, unsigned start, unsigned count)
|
||||
elts++;
|
||||
BEGIN_RING(ctx->chan, RING_3D(VERTEX_END_GL), 2);
|
||||
OUT_RING (ctx->chan, 0);
|
||||
OUT_RING (ctx->chan, ctx->prim);
|
||||
OUT_RING (ctx->chan, NVC0_3D_VERTEX_BEGIN_GL_INSTANCE_CONT |
|
||||
(ctx->prim & ~NVC0_3D_VERTEX_BEGIN_GL_INSTANCE_NEXT));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -141,7 +146,8 @@ emit_vertices_i32(struct push_context *ctx, unsigned start, unsigned count)
|
||||
|
||||
BEGIN_RING_NI(ctx->chan, RING_3D(VERTEX_DATA), size);
|
||||
|
||||
ctx->translate->run_elts(ctx->translate, elts, nr, 0, ctx->chan->cur);
|
||||
ctx->translate->run_elts(ctx->translate, elts, nr, ctx->instance_id,
|
||||
ctx->chan->cur);
|
||||
|
||||
ctx->chan->cur += size;
|
||||
count -= nr;
|
||||
@@ -152,7 +158,8 @@ emit_vertices_i32(struct push_context *ctx, unsigned start, unsigned count)
|
||||
elts++;
|
||||
BEGIN_RING(ctx->chan, RING_3D(VERTEX_END_GL), 2);
|
||||
OUT_RING (ctx->chan, 0);
|
||||
OUT_RING (ctx->chan, ctx->prim);
|
||||
OUT_RING (ctx->chan, NVC0_3D_VERTEX_BEGIN_GL_INSTANCE_CONT |
|
||||
(ctx->prim & ~NVC0_3D_VERTEX_BEGIN_GL_INSTANCE_NEXT));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -166,7 +173,8 @@ emit_vertices_seq(struct push_context *ctx, unsigned start, unsigned count)
|
||||
|
||||
BEGIN_RING_NI(ctx->chan, RING_3D(VERTEX_DATA), size);
|
||||
|
||||
ctx->translate->run(ctx->translate, start, push, 0, ctx->chan->cur);
|
||||
ctx->translate->run(ctx->translate, start, push, ctx->instance_id,
|
||||
ctx->chan->cur);
|
||||
ctx->chan->cur += size;
|
||||
count -= push;
|
||||
start += push;
|
||||
@@ -244,6 +252,7 @@ nvc0_push_vbo(struct nvc0_context *nvc0, const struct pipe_draw_info *info)
|
||||
ctx.restart_index = 0;
|
||||
}
|
||||
|
||||
ctx.instance_id = info->start_instance;
|
||||
ctx.prim = nvc0_prim_gl(info->mode);
|
||||
|
||||
while (inst--) {
|
||||
@@ -268,6 +277,7 @@ nvc0_push_vbo(struct nvc0_context *nvc0, const struct pipe_draw_info *info)
|
||||
}
|
||||
IMMED_RING(ctx.chan, RING_3D(VERTEX_END_GL), 0);
|
||||
|
||||
ctx.instance_id++;
|
||||
ctx.prim |= NVC0_3D_VERTEX_BEGIN_GL_INSTANCE_NEXT;
|
||||
}
|
||||
|
||||
|
||||
@@ -110,6 +110,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_SHADER_STENCIL_EXPORT:
|
||||
return 0;
|
||||
case PIPE_CAP_PRIMITIVE_RESTART:
|
||||
case PIPE_CAP_INSTANCED_DRAWING:
|
||||
return 1;
|
||||
default:
|
||||
NOUVEAU_ERR("unknown PIPE_CAP %d\n", param);
|
||||
|
||||
@@ -65,7 +65,8 @@ struct nvc0_vertex_element {
|
||||
struct nvc0_vertex_stateobj {
|
||||
struct translate *translate;
|
||||
unsigned num_elements;
|
||||
uint32_t instance_bits;
|
||||
uint32_t instance_elts;
|
||||
uint32_t instance_bufs;
|
||||
unsigned vtx_size;
|
||||
unsigned vtx_per_packet_max;
|
||||
struct nvc0_vertex_element element[1];
|
||||
|
||||
@@ -1085,6 +1085,20 @@ emit_fetch(struct bld_context *bld, const struct tgsi_full_instruction *insn,
|
||||
case TGSI_FILE_PREDICATE:
|
||||
res = bld_fetch_global(bld, &bld->pvs[idx][swz]);
|
||||
break;
|
||||
case TGSI_FILE_SYSTEM_VALUE:
|
||||
assert(bld->ti->sysval_loc[idx] < 0xf00); /* >= would mean special reg */
|
||||
res = new_value(bld->pc,
|
||||
bld->pc->is_fragprog ? NV_FILE_MEM_V : NV_FILE_MEM_A, 4);
|
||||
res->reg.address = bld->ti->sysval_loc[idx];
|
||||
|
||||
if (res->reg.file == NV_FILE_MEM_A)
|
||||
res = bld_insn_1(bld, NV_OP_VFETCH, res);
|
||||
else
|
||||
res = bld_interp(bld, NVC0_INTERP_FLAT, res);
|
||||
|
||||
/* mesa doesn't do real integers yet :-(and in GL this should be S32) */
|
||||
res = bld_cvt(bld, NV_TYPE_F32, NV_TYPE_U32, res);
|
||||
break;
|
||||
default:
|
||||
NOUVEAU_ERR("illegal/unhandled src reg file: %d\n", src->Register.File);
|
||||
abort();
|
||||
|
||||
@@ -58,7 +58,8 @@ nvc0_vertex_state_create(struct pipe_context *pipe,
|
||||
if (!so)
|
||||
return NULL;
|
||||
so->num_elements = num_elements;
|
||||
so->instance_bits = 0;
|
||||
so->instance_elts = 0;
|
||||
so->instance_bufs = 0;
|
||||
|
||||
transkey.nr_elements = 0;
|
||||
transkey.output_stride = 0;
|
||||
@@ -85,7 +86,7 @@ nvc0_vertex_state_create(struct pipe_context *pipe,
|
||||
}
|
||||
so->element[i].state |= i;
|
||||
|
||||
if (likely(!ve->instance_divisor)) {
|
||||
if (1) {
|
||||
unsigned j = transkey.nr_elements++;
|
||||
|
||||
transkey.element[j].type = TRANSLATE_ELEMENT_NORMAL;
|
||||
@@ -97,8 +98,11 @@ nvc0_vertex_state_create(struct pipe_context *pipe,
|
||||
transkey.element[j].output_format = fmt;
|
||||
transkey.element[j].output_offset = transkey.output_stride;
|
||||
transkey.output_stride += (util_format_get_stride(fmt, 1) + 3) & ~3;
|
||||
} else {
|
||||
so->instance_bits |= 1 << i;
|
||||
|
||||
if (unlikely(ve->instance_divisor)) {
|
||||
so->instance_elts |= 1 << i;
|
||||
so->instance_bufs |= 1 << vbi;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -141,6 +145,22 @@ nvc0_emit_vtxattr(struct nvc0_context *nvc0, struct pipe_vertex_buffer *vb,
|
||||
OUT_RINGf(chan, v[i]);
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
nvc0_vbuf_range(struct nvc0_context *nvc0, int vbi,
|
||||
uint32_t *base, uint32_t *size)
|
||||
{
|
||||
if (unlikely(nvc0->vertex->instance_bufs & (1 << vbi))) {
|
||||
/* TODO: use min and max instance divisor to get a proper range */
|
||||
*base = 0;
|
||||
*size = (nvc0->vtxbuf[vbi].max_index + 1) * nvc0->vtxbuf[vbi].stride;
|
||||
} else {
|
||||
assert(nvc0->vbo_max_index != ~0);
|
||||
*base = nvc0->vbo_min_index * nvc0->vtxbuf[vbi].stride;
|
||||
*size = (nvc0->vbo_max_index -
|
||||
nvc0->vbo_min_index + 1) * nvc0->vtxbuf[vbi].stride;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
nvc0_prevalidate_vbufs(struct nvc0_context *nvc0)
|
||||
{
|
||||
@@ -165,9 +185,7 @@ nvc0_prevalidate_vbufs(struct nvc0_context *nvc0)
|
||||
if (buf->status & NVC0_BUFFER_STATUS_USER_MEMORY) {
|
||||
nvc0->vbo_user |= 1 << i;
|
||||
assert(vb->stride > vb->buffer_offset);
|
||||
size = vb->stride * (nvc0->vbo_max_index -
|
||||
nvc0->vbo_min_index + 1);
|
||||
base = vb->stride * nvc0->vbo_min_index;
|
||||
nvc0_vbuf_range(nvc0, i, &base, &size);
|
||||
nvc0_user_buffer_upload(buf, base, size);
|
||||
} else {
|
||||
nvc0_buffer_migrate(nvc0, buf, NOUVEAU_BO_GART);
|
||||
@@ -184,7 +202,6 @@ static void
|
||||
nvc0_update_user_vbufs(struct nvc0_context *nvc0)
|
||||
{
|
||||
struct nouveau_channel *chan = nvc0->screen->base.channel;
|
||||
const uint32_t vertex_count = nvc0->vbo_max_index - nvc0->vbo_min_index + 1;
|
||||
uint32_t base, offset, size;
|
||||
int i;
|
||||
uint32_t written = 0;
|
||||
@@ -202,8 +219,7 @@ nvc0_update_user_vbufs(struct nvc0_context *nvc0)
|
||||
nvc0_emit_vtxattr(nvc0, vb, ve, i);
|
||||
continue;
|
||||
}
|
||||
size = vb->stride * vertex_count;
|
||||
base = vb->stride * nvc0->vbo_min_index;
|
||||
nvc0_vbuf_range(nvc0, b, &base, &size);
|
||||
|
||||
if (!(written & (1 << b))) {
|
||||
written |= 1 << b;
|
||||
@@ -253,13 +269,13 @@ nvc0_vertex_arrays_validate(struct nvc0_context *nvc0)
|
||||
vb = &nvc0->vtxbuf[ve->pipe.vertex_buffer_index];
|
||||
|
||||
if (unlikely(ve->pipe.instance_divisor)) {
|
||||
if (!(nvc0->state.instance_bits & (1 << i))) {
|
||||
if (!(nvc0->state.instance_elts & (1 << i))) {
|
||||
IMMED_RING(chan, RING_3D(VERTEX_ARRAY_PER_INSTANCE(i)), 1);
|
||||
}
|
||||
BEGIN_RING(chan, RING_3D(VERTEX_ARRAY_DIVISOR(i)), 1);
|
||||
OUT_RING (chan, ve->pipe.instance_divisor);
|
||||
} else
|
||||
if (unlikely(nvc0->state.instance_bits & (1 << i))) {
|
||||
if (unlikely(nvc0->state.instance_elts & (1 << i))) {
|
||||
IMMED_RING(chan, RING_3D(VERTEX_ARRAY_PER_INSTANCE(i)), 0);
|
||||
}
|
||||
|
||||
@@ -293,7 +309,7 @@ nvc0_vertex_arrays_validate(struct nvc0_context *nvc0)
|
||||
}
|
||||
|
||||
nvc0->state.num_vtxelts = vertex->num_elements;
|
||||
nvc0->state.instance_bits = vertex->instance_bits;
|
||||
nvc0->state.instance_elts = vertex->instance_elts;
|
||||
}
|
||||
|
||||
#define NVC0_PRIM_GL_CASE(n) \
|
||||
@@ -600,17 +616,18 @@ nvc0_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
|
||||
|
||||
nvc0_state_validate(nvc0);
|
||||
|
||||
if (nvc0->state.instance_base != info->start_instance) {
|
||||
nvc0->state.instance_base = info->start_instance;
|
||||
BEGIN_RING(chan, RING_3D(VB_INSTANCE_BASE), 1);
|
||||
OUT_RING (chan, info->start_instance);
|
||||
}
|
||||
|
||||
if (nvc0->vbo_fifo) {
|
||||
nvc0_push_vbo(nvc0, info);
|
||||
return;
|
||||
}
|
||||
|
||||
if (nvc0->state.instance_base != info->start_instance) {
|
||||
nvc0->state.instance_base = info->start_instance;
|
||||
/* NOTE: this does not affect the shader input, should it ? */
|
||||
BEGIN_RING(chan, RING_3D(VB_INSTANCE_BASE), 1);
|
||||
OUT_RING (chan, info->start_instance);
|
||||
}
|
||||
|
||||
if (nvc0->vbo_dirty) {
|
||||
BEGIN_RING(chan, RING_3D(VERTEX_ARRAY_FLUSH), 1);
|
||||
OUT_RING (chan, 0);
|
||||
|
||||
@@ -28,6 +28,7 @@ C_SOURCES = \
|
||||
nvfx_video_context.c
|
||||
|
||||
LIBRARY_INCLUDES = \
|
||||
$(LIBDRM_CFLAGS) \
|
||||
-I$(TOP)/src/gallium/drivers/nouveau/include
|
||||
|
||||
include ../../Makefile.template
|
||||
|
||||
@@ -9,7 +9,7 @@ except OSError:
|
||||
Return()
|
||||
|
||||
env.Append(CPPPATH = [
|
||||
'#/include',
|
||||
'#/include',
|
||||
'#/src/mesa',
|
||||
])
|
||||
|
||||
|
||||
@@ -1,458 +0,0 @@
|
||||
/* This file is autogenerated from eg_states.h - do not edit directly */
|
||||
/* autogenerating script is gen_eg_states.py */
|
||||
|
||||
/* EG_CONFIG */
|
||||
#define EG_CONFIG__SQ_CONFIG 0
|
||||
#define EG_CONFIG__SPI_CONFIG_CNTL 1
|
||||
#define EG_CONFIG__SPI_CONFIG_CNTL_1 2
|
||||
#define EG_CONFIG__SQ_GPR_RESOURCE_MGMT_1 3
|
||||
#define EG_CONFIG__SQ_GPR_RESOURCE_MGMT_2 4
|
||||
#define EG_CONFIG__SQ_GPR_RESOURCE_MGMT_3 5
|
||||
#define EG_CONFIG__SQ_THREAD_RESOURCE_MGMT_1 6
|
||||
#define EG_CONFIG__SQ_THREAD_RESOURCE_MGMT_2 7
|
||||
#define EG_CONFIG__SQ_STACK_RESOURCE_MGMT_1 8
|
||||
#define EG_CONFIG__SQ_STACK_RESOURCE_MGMT_2 9
|
||||
#define EG_CONFIG__SQ_STACK_RESOURCE_MGMT_3 10
|
||||
#define EG_CONFIG__SQ_DYN_GPR_CNTL_PS_FLUSH_REQ 11
|
||||
#define EG_CONFIG__PA_CL_ENHANCE 12
|
||||
#define EG_CONFIG__SQ_DYN_GPR_RESOURCE_LIMIT_1 13
|
||||
#define EG_CONFIG__SQ_LDS_ALLOC_PS 14
|
||||
#define EG_CONFIG__SX_MISC 15
|
||||
#define EG_CONFIG__SQ_ESGS_RING_ITEMSIZE 16
|
||||
#define EG_CONFIG__SQ_GSVS_RING_ITEMSIZE 17
|
||||
#define EG_CONFIG__SQ_ESTMP_RING_ITEMSIZE 18
|
||||
#define EG_CONFIG__SQ_GSTMP_RING_ITEMSIZE 19
|
||||
#define EG_CONFIG__SQ_VSTMP_RING_ITEMSIZE 20
|
||||
#define EG_CONFIG__SQ_PSTMP_RING_ITEMSIZE 21
|
||||
#define EG_CONFIG__SQ_GS_VERT_ITEMSIZE 22
|
||||
#define EG_CONFIG__SQ_GS_VERT_ITEMSIZE_1 23
|
||||
#define EG_CONFIG__SQ_GS_VERT_ITEMSIZE_2 24
|
||||
#define EG_CONFIG__SQ_GS_VERT_ITEMSIZE_3 25
|
||||
#define EG_CONFIG__VGT_OUTPUT_PATH_CNTL 26
|
||||
#define EG_CONFIG__VGT_HOS_CNTL 27
|
||||
#define EG_CONFIG__VGT_HOS_MAX_TESS_LEVEL 28
|
||||
#define EG_CONFIG__VGT_HOS_MIN_TESS_LEVEL 29
|
||||
#define EG_CONFIG__VGT_HOS_REUSE_DEPTH 30
|
||||
#define EG_CONFIG__VGT_GROUP_PRIM_TYPE 31
|
||||
#define EG_CONFIG__VGT_GROUP_FIRST_DECR 32
|
||||
#define EG_CONFIG__VGT_GROUP_DECR 33
|
||||
#define EG_CONFIG__VGT_GROUP_VECT_0_CNTL 34
|
||||
#define EG_CONFIG__VGT_GROUP_VECT_1_CNTL 35
|
||||
#define EG_CONFIG__VGT_GROUP_VECT_0_FMT_CNTL 36
|
||||
#define EG_CONFIG__VGT_GROUP_VECT_1_FMT_CNTL 37
|
||||
#define EG_CONFIG__VGT_GS_MODE 38
|
||||
#define EG_CONFIG__PA_SC_MODE_CNTL_0 39
|
||||
#define EG_CONFIG__PA_SC_MODE_CNTL_1 40
|
||||
#define EG_CONFIG__VGT_REUSE_OFF 41
|
||||
#define EG_CONFIG__VGT_VTX_CNT_EN 42
|
||||
#define EG_CONFIG__VGT_SHADER_STAGES_EN 43
|
||||
#define EG_CONFIG__VGT_STRMOUT_CONFIG 44
|
||||
#define EG_CONFIG__VGT_STRMOUT_BUFFER_CONFIG 45
|
||||
#define EG_CONFIG_SIZE 46
|
||||
#define EG_CONFIG_PM4 128
|
||||
|
||||
/* EG_CB_CNTL */
|
||||
#define EG_CB_CNTL__CB_TARGET_MASK 0
|
||||
#define EG_CB_CNTL__CB_SHADER_MASK 1
|
||||
#define EG_CB_CNTL__CB_COLOR_CONTROL 2
|
||||
#define EG_CB_CNTL__PA_SC_AA_CONFIG 3
|
||||
#define EG_CB_CNTL__PA_SC_AA_SAMPLE_LOCS_MCTX 4
|
||||
#define EG_CB_CNTL__PA_SC_AA_MASK 5
|
||||
#define EG_CB_CNTL_SIZE 6
|
||||
#define EG_CB_CNTL_PM4 128
|
||||
|
||||
/* EG_RASTERIZER */
|
||||
#define EG_RASTERIZER__SPI_INTERP_CONTROL_0 0
|
||||
#define EG_RASTERIZER__PA_CL_CLIP_CNTL 1
|
||||
#define EG_RASTERIZER__PA_SU_SC_MODE_CNTL 2
|
||||
#define EG_RASTERIZER__PA_CL_VS_OUT_CNTL 3
|
||||
#define EG_RASTERIZER__PA_CL_NANINF_CNTL 4
|
||||
#define EG_RASTERIZER__PA_SU_POINT_SIZE 5
|
||||
#define EG_RASTERIZER__PA_SU_POINT_MINMAX 6
|
||||
#define EG_RASTERIZER__PA_SU_LINE_CNTL 7
|
||||
#define EG_RASTERIZER__PA_SC_MPASS_PS_CNTL 8
|
||||
#define EG_RASTERIZER__PA_SC_LINE_CNTL 9
|
||||
#define EG_RASTERIZER__PA_SU_VTX_CNTL 10
|
||||
#define EG_RASTERIZER__PA_CL_GB_VERT_CLIP_ADJ 11
|
||||
#define EG_RASTERIZER__PA_CL_GB_VERT_DISC_ADJ 12
|
||||
#define EG_RASTERIZER__PA_CL_GB_HORZ_CLIP_ADJ 13
|
||||
#define EG_RASTERIZER__PA_CL_GB_HORZ_DISC_ADJ 14
|
||||
#define EG_RASTERIZER__PA_SU_POLY_OFFSET_DB_FMT_CNTL 15
|
||||
#define EG_RASTERIZER__PA_SU_POLY_OFFSET_CLAMP 16
|
||||
#define EG_RASTERIZER__PA_SU_POLY_OFFSET_FRONT_SCALE 17
|
||||
#define EG_RASTERIZER__PA_SU_POLY_OFFSET_FRONT_OFFSET 18
|
||||
#define EG_RASTERIZER__PA_SU_POLY_OFFSET_BACK_SCALE 19
|
||||
#define EG_RASTERIZER__PA_SU_POLY_OFFSET_BACK_OFFSET 20
|
||||
#define EG_RASTERIZER_SIZE 21
|
||||
#define EG_RASTERIZER_PM4 128
|
||||
|
||||
/* EG_VIEWPORT */
|
||||
#define EG_VIEWPORT__PA_SC_VPORT_ZMIN_0 0
|
||||
#define EG_VIEWPORT__PA_SC_VPORT_ZMAX_0 1
|
||||
#define EG_VIEWPORT__PA_CL_VPORT_XSCALE_0 2
|
||||
#define EG_VIEWPORT__PA_CL_VPORT_YSCALE_0 3
|
||||
#define EG_VIEWPORT__PA_CL_VPORT_ZSCALE_0 4
|
||||
#define EG_VIEWPORT__PA_CL_VPORT_XOFFSET_0 5
|
||||
#define EG_VIEWPORT__PA_CL_VPORT_YOFFSET_0 6
|
||||
#define EG_VIEWPORT__PA_CL_VPORT_ZOFFSET_0 7
|
||||
#define EG_VIEWPORT__PA_CL_VTE_CNTL 8
|
||||
#define EG_VIEWPORT_SIZE 9
|
||||
#define EG_VIEWPORT_PM4 128
|
||||
|
||||
/* EG_SCISSOR */
|
||||
#define EG_SCISSOR__PA_SC_SCREEN_SCISSOR_TL 0
|
||||
#define EG_SCISSOR__PA_SC_SCREEN_SCISSOR_BR 1
|
||||
#define EG_SCISSOR__PA_SC_WINDOW_OFFSET 2
|
||||
#define EG_SCISSOR__PA_SC_WINDOW_SCISSOR_TL 3
|
||||
#define EG_SCISSOR__PA_SC_WINDOW_SCISSOR_BR 4
|
||||
#define EG_SCISSOR__PA_SC_CLIPRECT_RULE 5
|
||||
#define EG_SCISSOR__PA_SC_CLIPRECT_0_TL 6
|
||||
#define EG_SCISSOR__PA_SC_CLIPRECT_0_BR 7
|
||||
#define EG_SCISSOR__PA_SC_CLIPRECT_1_TL 8
|
||||
#define EG_SCISSOR__PA_SC_CLIPRECT_1_BR 9
|
||||
#define EG_SCISSOR__PA_SC_CLIPRECT_2_TL 10
|
||||
#define EG_SCISSOR__PA_SC_CLIPRECT_2_BR 11
|
||||
#define EG_SCISSOR__PA_SC_CLIPRECT_3_TL 12
|
||||
#define EG_SCISSOR__PA_SC_CLIPRECT_3_BR 13
|
||||
#define EG_SCISSOR__PA_SC_EDGERULE 14
|
||||
#define EG_SCISSOR__PA_SC_GENERIC_SCISSOR_TL 15
|
||||
#define EG_SCISSOR__PA_SC_GENERIC_SCISSOR_BR 16
|
||||
#define EG_SCISSOR__PA_SC_VPORT_SCISSOR_0_TL 17
|
||||
#define EG_SCISSOR__PA_SC_VPORT_SCISSOR_0_BR 18
|
||||
#define EG_SCISSOR__PA_SU_HARDWARE_SCREEN_OFFSET 19
|
||||
#define EG_SCISSOR_SIZE 20
|
||||
#define EG_SCISSOR_PM4 128
|
||||
|
||||
/* EG_BLEND */
|
||||
#define EG_BLEND__CB_BLEND_RED 0
|
||||
#define EG_BLEND__CB_BLEND_GREEN 1
|
||||
#define EG_BLEND__CB_BLEND_BLUE 2
|
||||
#define EG_BLEND__CB_BLEND_ALPHA 3
|
||||
#define EG_BLEND__CB_BLEND0_CONTROL 4
|
||||
#define EG_BLEND__CB_BLEND1_CONTROL 5
|
||||
#define EG_BLEND__CB_BLEND2_CONTROL 6
|
||||
#define EG_BLEND__CB_BLEND3_CONTROL 7
|
||||
#define EG_BLEND__CB_BLEND4_CONTROL 8
|
||||
#define EG_BLEND__CB_BLEND5_CONTROL 9
|
||||
#define EG_BLEND__CB_BLEND6_CONTROL 10
|
||||
#define EG_BLEND__CB_BLEND7_CONTROL 11
|
||||
#define EG_BLEND_SIZE 12
|
||||
#define EG_BLEND_PM4 128
|
||||
|
||||
/* EG_DSA */
|
||||
#define EG_DSA__DB_STENCIL_CLEAR 0
|
||||
#define EG_DSA__DB_DEPTH_CLEAR 1
|
||||
#define EG_DSA__SX_ALPHA_TEST_CONTROL 2
|
||||
#define EG_DSA__DB_STENCILREFMASK 3
|
||||
#define EG_DSA__DB_STENCILREFMASK_BF 4
|
||||
#define EG_DSA__SX_ALPHA_REF 5
|
||||
#define EG_DSA__SPI_FOG_CNTL 6
|
||||
#define EG_DSA__DB_DEPTH_CONTROL 7
|
||||
#define EG_DSA__DB_SHADER_CONTROL 8
|
||||
#define EG_DSA__DB_RENDER_CONTROL 9
|
||||
#define EG_DSA__DB_COUNT_CONTROL 10
|
||||
#define EG_DSA__DB_RENDER_OVERRIDE 11
|
||||
#define EG_DSA__DB_RENDER_OVERRIDE2 12
|
||||
#define EG_DSA__DB_SRESULTS_COMPARE_STATE0 13
|
||||
#define EG_DSA__DB_SRESULTS_COMPARE_STATE1 14
|
||||
#define EG_DSA__DB_PRELOAD_CONTROL 15
|
||||
#define EG_DSA__DB_ALPHA_TO_MASK 16
|
||||
#define EG_DSA_SIZE 17
|
||||
#define EG_DSA_PM4 128
|
||||
|
||||
/* EG_VS_SHADER */
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_0 0
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_1 1
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_2 2
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_3 3
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_4 4
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_5 5
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_6 6
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_7 7
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_8 8
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_9 9
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_10 10
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_11 11
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_12 12
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_13 13
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_14 14
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_15 15
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_16 16
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_17 17
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_18 18
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_19 19
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_20 20
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_21 21
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_22 22
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_23 23
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_24 24
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_25 25
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_26 26
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_27 27
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_28 28
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_29 29
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_30 30
|
||||
#define EG_VS_SHADER__SQ_VTX_SEMANTIC_31 31
|
||||
#define EG_VS_SHADER__SPI_VS_OUT_ID_0 32
|
||||
#define EG_VS_SHADER__SPI_VS_OUT_ID_1 33
|
||||
#define EG_VS_SHADER__SPI_VS_OUT_ID_2 34
|
||||
#define EG_VS_SHADER__SPI_VS_OUT_ID_3 35
|
||||
#define EG_VS_SHADER__SPI_VS_OUT_ID_4 36
|
||||
#define EG_VS_SHADER__SPI_VS_OUT_ID_5 37
|
||||
#define EG_VS_SHADER__SPI_VS_OUT_ID_6 38
|
||||
#define EG_VS_SHADER__SPI_VS_OUT_ID_7 39
|
||||
#define EG_VS_SHADER__SPI_VS_OUT_ID_8 40
|
||||
#define EG_VS_SHADER__SPI_VS_OUT_ID_9 41
|
||||
#define EG_VS_SHADER__SPI_VS_OUT_CONFIG 42
|
||||
#define EG_VS_SHADER__SQ_PGM_START_VS 43
|
||||
#define EG_VS_SHADER__SQ_PGM_RESOURCES_VS 44
|
||||
#define EG_VS_SHADER__SQ_PGM_RESOURCES_2_VS 45
|
||||
#define EG_VS_SHADER__SQ_PGM_START_FS 46
|
||||
#define EG_VS_SHADER__SQ_PGM_RESOURCES_FS 47
|
||||
#define EG_VS_SHADER_SIZE 48
|
||||
#define EG_VS_SHADER_PM4 128
|
||||
|
||||
/* EG_PS_SHADER */
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_0 0
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_1 1
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_2 2
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_3 3
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_4 4
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_5 5
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_6 6
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_7 7
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_8 8
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_9 9
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_10 10
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_11 11
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_12 12
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_13 13
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_14 14
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_15 15
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_16 16
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_17 17
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_18 18
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_19 19
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_20 20
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_21 21
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_22 22
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_23 23
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_24 24
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_25 25
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_26 26
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_27 27
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_28 28
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_29 29
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_30 30
|
||||
#define EG_PS_SHADER__SPI_PS_INPUT_CNTL_31 31
|
||||
#define EG_PS_SHADER__SPI_THREAD_GROUPING 32
|
||||
#define EG_PS_SHADER__SPI_PS_IN_CONTROL_0 33
|
||||
#define EG_PS_SHADER__SPI_PS_IN_CONTROL_1 34
|
||||
#define EG_PS_SHADER__SPI_INPUT_Z 35
|
||||
#define EG_PS_SHADER__SPI_BARYC_CNTL 36
|
||||
#define EG_PS_SHADER__SPI_PS_IN_CONTROL_2 37
|
||||
#define EG_PS_SHADER__SPI_COMPUTE_INPUT_CNTL 38
|
||||
#define EG_PS_SHADER__SQ_PGM_START_PS 39
|
||||
#define EG_PS_SHADER__SQ_PGM_RESOURCES_PS 40
|
||||
#define EG_PS_SHADER__SQ_PGM_RESOURCES_2_PS 41
|
||||
#define EG_PS_SHADER__SQ_PGM_EXPORTS_PS 42
|
||||
#define EG_PS_SHADER_SIZE 43
|
||||
#define EG_PS_SHADER_PM4 128
|
||||
|
||||
/* EG_UCP */
|
||||
#define EG_UCP__PA_CL_UCP0_X 0
|
||||
#define EG_UCP__PA_CL_UCP0_Y 1
|
||||
#define EG_UCP__PA_CL_UCP0_Z 2
|
||||
#define EG_UCP__PA_CL_UCP0_W 3
|
||||
#define EG_UCP__PA_CL_UCP1_X 4
|
||||
#define EG_UCP__PA_CL_UCP1_Y 5
|
||||
#define EG_UCP__PA_CL_UCP1_Z 6
|
||||
#define EG_UCP__PA_CL_UCP1_W 7
|
||||
#define EG_UCP__PA_CL_UCP2_X 8
|
||||
#define EG_UCP__PA_CL_UCP2_Y 9
|
||||
#define EG_UCP__PA_CL_UCP2_Z 10
|
||||
#define EG_UCP__PA_CL_UCP2_W 11
|
||||
#define EG_UCP__PA_CL_UCP3_X 12
|
||||
#define EG_UCP__PA_CL_UCP3_Y 13
|
||||
#define EG_UCP__PA_CL_UCP3_Z 14
|
||||
#define EG_UCP__PA_CL_UCP3_W 15
|
||||
#define EG_UCP__PA_CL_UCP4_X 16
|
||||
#define EG_UCP__PA_CL_UCP4_Y 17
|
||||
#define EG_UCP__PA_CL_UCP4_Z 18
|
||||
#define EG_UCP__PA_CL_UCP4_W 19
|
||||
#define EG_UCP__PA_CL_UCP5_X 20
|
||||
#define EG_UCP__PA_CL_UCP5_Y 21
|
||||
#define EG_UCP__PA_CL_UCP5_Z 22
|
||||
#define EG_UCP__PA_CL_UCP5_W 23
|
||||
#define EG_UCP_SIZE 24
|
||||
#define EG_UCP_PM4 128
|
||||
|
||||
/* EG_VS_CBUF */
|
||||
#define EG_VS_CBUF__ALU_CONST_BUFFER_SIZE_VS_0 0
|
||||
#define EG_VS_CBUF__ALU_CONST_CACHE_VS_0 1
|
||||
#define EG_VS_CBUF_SIZE 2
|
||||
#define EG_VS_CBUF_PM4 128
|
||||
|
||||
/* EG_PS_CBUF */
|
||||
#define EG_PS_CBUF__ALU_CONST_BUFFER_SIZE_PS_0 0
|
||||
#define EG_PS_CBUF__ALU_CONST_CACHE_PS_0 1
|
||||
#define EG_PS_CBUF_SIZE 2
|
||||
#define EG_PS_CBUF_PM4 128
|
||||
|
||||
/* EG_PS_RESOURCE */
|
||||
#define EG_PS_RESOURCE__RESOURCE0_WORD0 0
|
||||
#define EG_PS_RESOURCE__RESOURCE0_WORD1 1
|
||||
#define EG_PS_RESOURCE__RESOURCE0_WORD2 2
|
||||
#define EG_PS_RESOURCE__RESOURCE0_WORD3 3
|
||||
#define EG_PS_RESOURCE__RESOURCE0_WORD4 4
|
||||
#define EG_PS_RESOURCE__RESOURCE0_WORD5 5
|
||||
#define EG_PS_RESOURCE__RESOURCE0_WORD6 6
|
||||
#define EG_PS_RESOURCE__RESOURCE0_WORD7 7
|
||||
#define EG_PS_RESOURCE_SIZE 8
|
||||
#define EG_PS_RESOURCE_PM4 128
|
||||
|
||||
/* EG_VS_RESOURCE */
|
||||
#define EG_VS_RESOURCE__RESOURCE160_WORD0 0
|
||||
#define EG_VS_RESOURCE__RESOURCE160_WORD1 1
|
||||
#define EG_VS_RESOURCE__RESOURCE160_WORD2 2
|
||||
#define EG_VS_RESOURCE__RESOURCE160_WORD3 3
|
||||
#define EG_VS_RESOURCE__RESOURCE160_WORD4 4
|
||||
#define EG_VS_RESOURCE__RESOURCE160_WORD5 5
|
||||
#define EG_VS_RESOURCE__RESOURCE160_WORD6 6
|
||||
#define EG_VS_RESOURCE__RESOURCE160_WORD7 7
|
||||
#define EG_VS_RESOURCE_SIZE 8
|
||||
#define EG_VS_RESOURCE_PM4 128
|
||||
|
||||
/* EG_FS_RESOURCE */
|
||||
#define EG_FS_RESOURCE__RESOURCE320_WORD0 0
|
||||
#define EG_FS_RESOURCE__RESOURCE320_WORD1 1
|
||||
#define EG_FS_RESOURCE__RESOURCE320_WORD2 2
|
||||
#define EG_FS_RESOURCE__RESOURCE320_WORD3 3
|
||||
#define EG_FS_RESOURCE__RESOURCE320_WORD4 4
|
||||
#define EG_FS_RESOURCE__RESOURCE320_WORD5 5
|
||||
#define EG_FS_RESOURCE__RESOURCE320_WORD6 6
|
||||
#define EG_FS_RESOURCE__RESOURCE320_WORD7 7
|
||||
#define EG_FS_RESOURCE_SIZE 8
|
||||
#define EG_FS_RESOURCE_PM4 128
|
||||
|
||||
/* EG_GS_RESOURCE */
|
||||
#define EG_GS_RESOURCE__RESOURCE336_WORD0 0
|
||||
#define EG_GS_RESOURCE__RESOURCE336_WORD1 1
|
||||
#define EG_GS_RESOURCE__RESOURCE336_WORD2 2
|
||||
#define EG_GS_RESOURCE__RESOURCE336_WORD3 3
|
||||
#define EG_GS_RESOURCE__RESOURCE336_WORD4 4
|
||||
#define EG_GS_RESOURCE__RESOURCE336_WORD5 5
|
||||
#define EG_GS_RESOURCE__RESOURCE336_WORD6 6
|
||||
#define EG_GS_RESOURCE__RESOURCE336_WORD7 7
|
||||
#define EG_GS_RESOURCE_SIZE 8
|
||||
#define EG_GS_RESOURCE_PM4 128
|
||||
|
||||
/* EG_PS_SAMPLER */
|
||||
#define EG_PS_SAMPLER__SQ_TEX_SAMPLER_WORD0_0 0
|
||||
#define EG_PS_SAMPLER__SQ_TEX_SAMPLER_WORD1_0 1
|
||||
#define EG_PS_SAMPLER__SQ_TEX_SAMPLER_WORD2_0 2
|
||||
#define EG_PS_SAMPLER_SIZE 3
|
||||
#define EG_PS_SAMPLER_PM4 128
|
||||
|
||||
/* EG_VS_SAMPLER */
|
||||
#define EG_VS_SAMPLER__SQ_TEX_SAMPLER_WORD0_18 0
|
||||
#define EG_VS_SAMPLER__SQ_TEX_SAMPLER_WORD1_18 1
|
||||
#define EG_VS_SAMPLER__SQ_TEX_SAMPLER_WORD2_18 2
|
||||
#define EG_VS_SAMPLER_SIZE 3
|
||||
#define EG_VS_SAMPLER_PM4 128
|
||||
|
||||
/* EG_GS_SAMPLER */
|
||||
#define EG_GS_SAMPLER__SQ_TEX_SAMPLER_WORD0_36 0
|
||||
#define EG_GS_SAMPLER__SQ_TEX_SAMPLER_WORD1_36 1
|
||||
#define EG_GS_SAMPLER__SQ_TEX_SAMPLER_WORD2_36 2
|
||||
#define EG_GS_SAMPLER_SIZE 3
|
||||
#define EG_GS_SAMPLER_PM4 128
|
||||
|
||||
/* EG_PS_SAMPLER_BORDER */
|
||||
#define EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_INDEX 0
|
||||
#define EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_RED 1
|
||||
#define EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_GREEN 2
|
||||
#define EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_BLUE 3
|
||||
#define EG_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_ALPHA 4
|
||||
#define EG_PS_SAMPLER_BORDER_SIZE 5
|
||||
#define EG_PS_SAMPLER_BORDER_PM4 128
|
||||
|
||||
/* EG_VS_SAMPLER_BORDER */
|
||||
#define EG_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_INDEX 0
|
||||
#define EG_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_RED 1
|
||||
#define EG_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_GREEN 2
|
||||
#define EG_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_BLUE 3
|
||||
#define EG_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_ALPHA 4
|
||||
#define EG_VS_SAMPLER_BORDER_SIZE 5
|
||||
#define EG_VS_SAMPLER_BORDER_PM4 128
|
||||
|
||||
/* EG_GS_SAMPLER_BORDER */
|
||||
#define EG_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_INDEX 0
|
||||
#define EG_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_RED 1
|
||||
#define EG_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_GREEN 2
|
||||
#define EG_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_BLUE 3
|
||||
#define EG_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_ALPHA 4
|
||||
#define EG_GS_SAMPLER_BORDER_SIZE 5
|
||||
#define EG_GS_SAMPLER_BORDER_PM4 128
|
||||
|
||||
/* EG_CB */
|
||||
#define EG_CB__CB_COLOR0_BASE 0
|
||||
#define EG_CB__CB_COLOR0_PITCH 1
|
||||
#define EG_CB__CB_COLOR0_SLICE 2
|
||||
#define EG_CB__CB_COLOR0_VIEW 3
|
||||
#define EG_CB__CB_COLOR0_INFO 4
|
||||
#define EG_CB__CB_COLOR0_ATTRIB 5
|
||||
#define EG_CB__CB_COLOR0_DIM 6
|
||||
#define EG_CB_SIZE 7
|
||||
#define EG_CB_PM4 128
|
||||
|
||||
/* EG_DB */
|
||||
#define EG_DB__DB_HTILE_DATA_BASE 0
|
||||
#define EG_DB__DB_Z_INFO 1
|
||||
#define EG_DB__DB_STENCIL_INFO 2
|
||||
#define EG_DB__DB_DEPTH_SIZE 3
|
||||
#define EG_DB__DB_DEPTH_SLICE 4
|
||||
#define EG_DB__DB_DEPTH_VIEW 5
|
||||
#define EG_DB__DB_HTILE_SURFACE 6
|
||||
#define EG_DB__DB_Z_READ_BASE 7
|
||||
#define EG_DB__DB_STENCIL_READ_BASE 8
|
||||
#define EG_DB__DB_Z_WRITE_BASE 9
|
||||
#define EG_DB__DB_STENCIL_WRITE_BASE 10
|
||||
#define EG_DB_SIZE 11
|
||||
#define EG_DB_PM4 128
|
||||
|
||||
/* EG_VGT */
|
||||
#define EG_VGT__VGT_PRIMITIVE_TYPE 0
|
||||
#define EG_VGT__VGT_MAX_VTX_INDX 1
|
||||
#define EG_VGT__VGT_MIN_VTX_INDX 2
|
||||
#define EG_VGT__VGT_INDX_OFFSET 3
|
||||
#define EG_VGT__VGT_DMA_INDEX_TYPE 4
|
||||
#define EG_VGT__VGT_PRIMITIVEID_EN 5
|
||||
#define EG_VGT__VGT_DMA_NUM_INSTANCES 6
|
||||
#define EG_VGT__VGT_MULTI_PRIM_IB_RESET_EN 7
|
||||
#define EG_VGT__VGT_INSTANCE_STEP_RATE_0 8
|
||||
#define EG_VGT__VGT_INSTANCE_STEP_RATE_1 9
|
||||
#define EG_VGT_SIZE 10
|
||||
#define EG_VGT_PM4 128
|
||||
|
||||
/* EG_DRAW */
|
||||
#define EG_DRAW__VGT_NUM_INDICES 0
|
||||
#define EG_DRAW__VGT_DMA_BASE_HI 1
|
||||
#define EG_DRAW__VGT_DMA_BASE 2
|
||||
#define EG_DRAW__VGT_DRAW_INITIATOR 3
|
||||
#define EG_DRAW_SIZE 4
|
||||
#define EG_DRAW_PM4 128
|
||||
|
||||
/* EG_VGT_EVENT */
|
||||
#define EG_VGT_EVENT__VGT_EVENT_INITIATOR 0
|
||||
#define EG_VGT_EVENT_SIZE 1
|
||||
#define EG_VGT_EVENT_PM4 128
|
||||
|
||||
/* EG_CB_FLUSH */
|
||||
#define EG_CB_FLUSH_SIZE 0
|
||||
#define EG_CB_FLUSH_PM4 128
|
||||
|
||||
/* EG_DB_FLUSH */
|
||||
#define EG_DB_FLUSH_SIZE 0
|
||||
#define EG_DB_FLUSH_PM4 128
|
||||
|
||||
@@ -602,26 +602,24 @@ static int reserve_gpr(struct alu_bank_swizzle *bs, unsigned sel, unsigned chan,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int reserve_cfile(struct alu_bank_swizzle *bs, unsigned sel, unsigned chan)
|
||||
static int reserve_cfile(struct r600_bc *bc, struct alu_bank_swizzle *bs, unsigned sel, unsigned chan)
|
||||
{
|
||||
int res, resmatch = -1, resempty = -1;
|
||||
for (res = 3; res >= 0; --res) {
|
||||
if (bs->hw_cfile_addr[res] == -1)
|
||||
resempty = res;
|
||||
else if (bs->hw_cfile_addr[res] == sel &&
|
||||
int res, num_res = 4;
|
||||
if (bc->chiprev >= CHIPREV_R700) {
|
||||
num_res = 2;
|
||||
chan /= 2;
|
||||
}
|
||||
for (res = 0; res < num_res; ++res) {
|
||||
if (bs->hw_cfile_addr[res] == -1) {
|
||||
bs->hw_cfile_addr[res] = sel;
|
||||
bs->hw_cfile_elem[res] = chan;
|
||||
return 0;
|
||||
} else if (bs->hw_cfile_addr[res] == sel &&
|
||||
bs->hw_cfile_elem[res] == chan)
|
||||
resmatch = res;
|
||||
return 0; // Read for this scalar element already reserved, nothing to do here.
|
||||
}
|
||||
if (resmatch != -1)
|
||||
return 0; // Read for this scalar element already reserved, nothing to do here.
|
||||
else if (resempty != -1) {
|
||||
bs->hw_cfile_addr[resempty] = sel;
|
||||
bs->hw_cfile_elem[resempty] = chan;
|
||||
} else {
|
||||
// All cfile read ports are used, cannot reference vector element
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
// All cfile read ports are used, cannot reference vector element
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int is_gpr(unsigned sel)
|
||||
@@ -667,7 +665,7 @@ static int check_vector(struct r600_bc *bc, struct r600_bc_alu *alu,
|
||||
return r;
|
||||
}
|
||||
} else if (is_cfile(sel)) {
|
||||
r = reserve_cfile(bs, sel, elem);
|
||||
r = reserve_cfile(bc, bs, sel, elem);
|
||||
if (r)
|
||||
return r;
|
||||
}
|
||||
@@ -694,7 +692,7 @@ static int check_scalar(struct r600_bc *bc, struct r600_bc_alu *alu,
|
||||
const_count++;
|
||||
}
|
||||
if (is_cfile(sel)) {
|
||||
r = reserve_cfile(bs, sel, elem);
|
||||
r = reserve_cfile(bc, bs, sel, elem);
|
||||
if (r)
|
||||
return r;
|
||||
}
|
||||
@@ -915,6 +913,7 @@ static int merge_inst_groups(struct r600_bc *bc, struct r600_bc_alu *slots[5],
|
||||
|
||||
int i, j, r, src, num_src;
|
||||
int num_once_inst = 0;
|
||||
int have_mova = 0, have_rel = 0;
|
||||
|
||||
r = assign_alu_units(bc, alu_prev, prev);
|
||||
if (r)
|
||||
@@ -929,6 +928,12 @@ static int merge_inst_groups(struct r600_bc *bc, struct r600_bc_alu *slots[5],
|
||||
return 0;
|
||||
if (r600_bc_alu_nliterals(bc, prev[i], prev_literal, &prev_nliteral))
|
||||
return 0;
|
||||
if (is_alu_mova_inst(bc, prev[i])) {
|
||||
if (have_rel)
|
||||
return 0;
|
||||
have_mova = 1;
|
||||
}
|
||||
num_once_inst += is_alu_once_inst(bc, prev[i]);
|
||||
}
|
||||
if (slots[i] && r600_bc_alu_nliterals(bc, slots[i], literal, &nliteral))
|
||||
return 0;
|
||||
@@ -936,7 +941,6 @@ static int merge_inst_groups(struct r600_bc *bc, struct r600_bc_alu *slots[5],
|
||||
// let's check used slots
|
||||
if (prev[i] && !slots[i]) {
|
||||
result[i] = prev[i];
|
||||
num_once_inst += is_alu_once_inst(bc, prev[i]);
|
||||
continue;
|
||||
} else if (prev[i] && slots[i]) {
|
||||
if (result[4] == NULL && prev[4] == NULL && slots[4] == NULL) {
|
||||
@@ -962,6 +966,12 @@ static int merge_inst_groups(struct r600_bc *bc, struct r600_bc_alu *slots[5],
|
||||
|
||||
num_src = r600_bc_get_num_operands(bc, alu);
|
||||
for (src = 0; src < num_src; ++src) {
|
||||
if (alu->src[src].rel) {
|
||||
if (have_mova)
|
||||
return 0;
|
||||
have_rel = 1;
|
||||
}
|
||||
|
||||
// constants doesn't matter
|
||||
if (!is_gpr(alu->src[src].sel))
|
||||
continue;
|
||||
|
||||
@@ -288,6 +288,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_STREAM_OUTPUT:
|
||||
case PIPE_CAP_PRIMITIVE_RESTART:
|
||||
case PIPE_CAP_INDEP_BLEND_FUNC: /* FIXME allow this */
|
||||
case PIPE_CAP_INSTANCED_DRAWING:
|
||||
return 0;
|
||||
|
||||
/* Texturing. */
|
||||
|
||||
@@ -241,7 +241,7 @@ int r600_conv_pipe_prim(unsigned pprim, unsigned *prim);
|
||||
void r600_init_screen_texture_functions(struct pipe_screen *screen);
|
||||
void r600_init_surface_functions(struct r600_pipe_context *r600);
|
||||
uint32_t r600_translate_texformat(enum pipe_format format,
|
||||
const unsigned char *swizzle_view,
|
||||
const unsigned char *swizzle_view,
|
||||
uint32_t *word4_p, uint32_t *yuv_format_p);
|
||||
unsigned r600_texture_get_offset(struct r600_resource_texture *rtex,
|
||||
unsigned level, unsigned layer);
|
||||
|
||||
@@ -1822,7 +1822,9 @@ static int tgsi_tex(struct r600_shader_ctx *ctx)
|
||||
for (i = 0; i < 4; i++) {
|
||||
memset(&alu, 0, sizeof(struct r600_bc_alu));
|
||||
alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
|
||||
alu.src[0].sel = src_gpr;
|
||||
r = tgsi_src(ctx, &inst->Src[0], &alu.src[0]);
|
||||
if (r)
|
||||
return r;
|
||||
alu.src[0].chan = tgsi_chan(&inst->Src[0], i);
|
||||
alu.dst.sel = ctx->temp_reg;
|
||||
alu.dst.chan = i;
|
||||
@@ -2471,7 +2473,7 @@ static int tgsi_eg_arl(struct r600_shader_ctx *ctx)
|
||||
alu.dst.chan = 0;
|
||||
alu.dst.sel = ctx->temp_reg;
|
||||
alu.dst.write = 1;
|
||||
r = r600_bc_add_alu_type(ctx->bc, &alu, CTX_INST(V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU));
|
||||
r = r600_bc_add_alu(ctx->bc, &alu);
|
||||
if (r)
|
||||
return r;
|
||||
memset(&alu, 0, sizeof(struct r600_bc_alu));
|
||||
@@ -2482,7 +2484,7 @@ static int tgsi_eg_arl(struct r600_shader_ctx *ctx)
|
||||
alu.src[0].sel = ctx->temp_reg;
|
||||
alu.src[0].chan = 0;
|
||||
alu.last = 1;
|
||||
r = r600_bc_add_alu_type(ctx->bc, &alu, CTX_INST(V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU));
|
||||
r = r600_bc_add_alu(ctx->bc, &alu);
|
||||
if (r)
|
||||
return r;
|
||||
return 0;
|
||||
@@ -2515,7 +2517,7 @@ static int tgsi_r600_arl(struct r600_shader_ctx *ctx)
|
||||
|
||||
alu.last = 1;
|
||||
|
||||
r = r600_bc_add_alu_type(ctx->bc, &alu, CTX_INST(V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU));
|
||||
r = r600_bc_add_alu(ctx->bc, &alu);
|
||||
if (r)
|
||||
return r;
|
||||
ctx->bc->cf_last->r6xx_uses_waterfall = 1;
|
||||
|
||||
@@ -1,543 +0,0 @@
|
||||
/* This file is autogenerated from r600_states.h - do not edit directly */
|
||||
/* autogenerating script is gen_r600_states.py */
|
||||
|
||||
/* R600_CONFIG */
|
||||
#define R600_CONFIG__SQ_CONFIG 0
|
||||
#define R600_CONFIG__SQ_GPR_RESOURCE_MGMT_1 1
|
||||
#define R600_CONFIG__SQ_GPR_RESOURCE_MGMT_2 2
|
||||
#define R600_CONFIG__SQ_THREAD_RESOURCE_MGMT 3
|
||||
#define R600_CONFIG__SQ_STACK_RESOURCE_MGMT_1 4
|
||||
#define R600_CONFIG__SQ_STACK_RESOURCE_MGMT_2 5
|
||||
#define R600_CONFIG__SQ_DYN_GPR_CNTL_PS_FLUSH_REQ 6
|
||||
#define R600_CONFIG__TA_CNTL_AUX 7
|
||||
#define R600_CONFIG__VC_ENHANCE 8
|
||||
#define R600_CONFIG__DB_DEBUG 9
|
||||
#define R600_CONFIG__DB_WATERMARKS 10
|
||||
#define R600_CONFIG__SX_MISC 11
|
||||
#define R600_CONFIG__SPI_THREAD_GROUPING 12
|
||||
#define R600_CONFIG__SQ_ESGS_RING_ITEMSIZE 13
|
||||
#define R600_CONFIG__SQ_GSVS_RING_ITEMSIZE 14
|
||||
#define R600_CONFIG__SQ_ESTMP_RING_ITEMSIZE 15
|
||||
#define R600_CONFIG__SQ_GSTMP_RING_ITEMSIZE 16
|
||||
#define R600_CONFIG__SQ_VSTMP_RING_ITEMSIZE 17
|
||||
#define R600_CONFIG__SQ_PSTMP_RING_ITEMSIZE 18
|
||||
#define R600_CONFIG__SQ_FBUF_RING_ITEMSIZE 19
|
||||
#define R600_CONFIG__SQ_REDUC_RING_ITEMSIZE 20
|
||||
#define R600_CONFIG__SQ_GS_VERT_ITEMSIZE 21
|
||||
#define R600_CONFIG__VGT_OUTPUT_PATH_CNTL 22
|
||||
#define R600_CONFIG__VGT_HOS_CNTL 23
|
||||
#define R600_CONFIG__VGT_HOS_MAX_TESS_LEVEL 24
|
||||
#define R600_CONFIG__VGT_HOS_MIN_TESS_LEVEL 25
|
||||
#define R600_CONFIG__VGT_HOS_REUSE_DEPTH 26
|
||||
#define R600_CONFIG__VGT_GROUP_PRIM_TYPE 27
|
||||
#define R600_CONFIG__VGT_GROUP_FIRST_DECR 28
|
||||
#define R600_CONFIG__VGT_GROUP_DECR 29
|
||||
#define R600_CONFIG__VGT_GROUP_VECT_0_CNTL 30
|
||||
#define R600_CONFIG__VGT_GROUP_VECT_1_CNTL 31
|
||||
#define R600_CONFIG__VGT_GROUP_VECT_0_FMT_CNTL 32
|
||||
#define R600_CONFIG__VGT_GROUP_VECT_1_FMT_CNTL 33
|
||||
#define R600_CONFIG__VGT_GS_MODE 34
|
||||
#define R600_CONFIG__PA_SC_MODE_CNTL 35
|
||||
#define R600_CONFIG__VGT_STRMOUT_EN 36
|
||||
#define R600_CONFIG__VGT_REUSE_OFF 37
|
||||
#define R600_CONFIG__VGT_VTX_CNT_EN 38
|
||||
#define R600_CONFIG__VGT_STRMOUT_BUFFER_EN 39
|
||||
#define R600_CONFIG_SIZE 40
|
||||
#define R600_CONFIG_PM4 128
|
||||
|
||||
/* R600_CB_CNTL */
|
||||
#define R600_CB_CNTL__CB_CLEAR_RED 0
|
||||
#define R600_CB_CNTL__CB_CLEAR_GREEN 1
|
||||
#define R600_CB_CNTL__CB_CLEAR_BLUE 2
|
||||
#define R600_CB_CNTL__CB_CLEAR_ALPHA 3
|
||||
#define R600_CB_CNTL__CB_SHADER_MASK 4
|
||||
#define R600_CB_CNTL__CB_TARGET_MASK 5
|
||||
#define R600_CB_CNTL__CB_FOG_RED 6
|
||||
#define R600_CB_CNTL__CB_FOG_GREEN 7
|
||||
#define R600_CB_CNTL__CB_FOG_BLUE 8
|
||||
#define R600_CB_CNTL__CB_COLOR_CONTROL 9
|
||||
#define R600_CB_CNTL__PA_SC_AA_CONFIG 10
|
||||
#define R600_CB_CNTL__PA_SC_AA_SAMPLE_LOCS_MCTX 11
|
||||
#define R600_CB_CNTL__PA_SC_AA_SAMPLE_LOCS_8S_WD1_MCTX 12
|
||||
#define R600_CB_CNTL__CB_CLRCMP_CONTROL 13
|
||||
#define R600_CB_CNTL__CB_CLRCMP_SRC 14
|
||||
#define R600_CB_CNTL__CB_CLRCMP_DST 15
|
||||
#define R600_CB_CNTL__CB_CLRCMP_MSK 16
|
||||
#define R600_CB_CNTL__PA_SC_AA_MASK 17
|
||||
#define R600_CB_CNTL__CB_SHADER_CONTROL 18
|
||||
#define R600_CB_CNTL_SIZE 19
|
||||
#define R600_CB_CNTL_PM4 128
|
||||
|
||||
/* R600_RASTERIZER */
|
||||
#define R600_RASTERIZER__SPI_INTERP_CONTROL_0 0
|
||||
#define R600_RASTERIZER__PA_CL_CLIP_CNTL 1
|
||||
#define R600_RASTERIZER__PA_SU_SC_MODE_CNTL 2
|
||||
#define R600_RASTERIZER__PA_CL_VS_OUT_CNTL 3
|
||||
#define R600_RASTERIZER__PA_CL_NANINF_CNTL 4
|
||||
#define R600_RASTERIZER__PA_SU_POINT_SIZE 5
|
||||
#define R600_RASTERIZER__PA_SU_POINT_MINMAX 6
|
||||
#define R600_RASTERIZER__PA_SU_LINE_CNTL 7
|
||||
#define R600_RASTERIZER__PA_SC_LINE_STIPPLE 8
|
||||
#define R600_RASTERIZER__PA_SC_MPASS_PS_CNTL 9
|
||||
#define R600_RASTERIZER__PA_SC_LINE_CNTL 10
|
||||
#define R600_RASTERIZER__PA_CL_GB_VERT_CLIP_ADJ 11
|
||||
#define R600_RASTERIZER__PA_CL_GB_VERT_DISC_ADJ 12
|
||||
#define R600_RASTERIZER__PA_CL_GB_HORZ_CLIP_ADJ 13
|
||||
#define R600_RASTERIZER__PA_CL_GB_HORZ_DISC_ADJ 14
|
||||
#define R600_RASTERIZER__PA_SU_POLY_OFFSET_DB_FMT_CNTL 15
|
||||
#define R600_RASTERIZER__PA_SU_POLY_OFFSET_CLAMP 16
|
||||
#define R600_RASTERIZER__PA_SU_POLY_OFFSET_FRONT_SCALE 17
|
||||
#define R600_RASTERIZER__PA_SU_POLY_OFFSET_FRONT_OFFSET 18
|
||||
#define R600_RASTERIZER__PA_SU_POLY_OFFSET_BACK_SCALE 19
|
||||
#define R600_RASTERIZER__PA_SU_POLY_OFFSET_BACK_OFFSET 20
|
||||
#define R600_RASTERIZER_SIZE 21
|
||||
#define R600_RASTERIZER_PM4 128
|
||||
|
||||
/* R600_VIEWPORT */
|
||||
#define R600_VIEWPORT__PA_SC_VPORT_ZMIN_0 0
|
||||
#define R600_VIEWPORT__PA_SC_VPORT_ZMAX_0 1
|
||||
#define R600_VIEWPORT__PA_CL_VPORT_XSCALE_0 2
|
||||
#define R600_VIEWPORT__PA_CL_VPORT_YSCALE_0 3
|
||||
#define R600_VIEWPORT__PA_CL_VPORT_ZSCALE_0 4
|
||||
#define R600_VIEWPORT__PA_CL_VPORT_XOFFSET_0 5
|
||||
#define R600_VIEWPORT__PA_CL_VPORT_YOFFSET_0 6
|
||||
#define R600_VIEWPORT__PA_CL_VPORT_ZOFFSET_0 7
|
||||
#define R600_VIEWPORT__PA_CL_VTE_CNTL 8
|
||||
#define R600_VIEWPORT_SIZE 9
|
||||
#define R600_VIEWPORT_PM4 128
|
||||
|
||||
/* R600_SCISSOR */
|
||||
#define R600_SCISSOR__PA_SC_SCREEN_SCISSOR_TL 0
|
||||
#define R600_SCISSOR__PA_SC_SCREEN_SCISSOR_BR 1
|
||||
#define R600_SCISSOR__PA_SC_WINDOW_OFFSET 2
|
||||
#define R600_SCISSOR__PA_SC_WINDOW_SCISSOR_TL 3
|
||||
#define R600_SCISSOR__PA_SC_WINDOW_SCISSOR_BR 4
|
||||
#define R600_SCISSOR__PA_SC_CLIPRECT_RULE 5
|
||||
#define R600_SCISSOR__PA_SC_CLIPRECT_0_TL 6
|
||||
#define R600_SCISSOR__PA_SC_CLIPRECT_0_BR 7
|
||||
#define R600_SCISSOR__PA_SC_CLIPRECT_1_TL 8
|
||||
#define R600_SCISSOR__PA_SC_CLIPRECT_1_BR 9
|
||||
#define R600_SCISSOR__PA_SC_CLIPRECT_2_TL 10
|
||||
#define R600_SCISSOR__PA_SC_CLIPRECT_2_BR 11
|
||||
#define R600_SCISSOR__PA_SC_CLIPRECT_3_TL 12
|
||||
#define R600_SCISSOR__PA_SC_CLIPRECT_3_BR 13
|
||||
#define R600_SCISSOR__PA_SC_EDGERULE 14
|
||||
#define R600_SCISSOR__PA_SC_GENERIC_SCISSOR_TL 15
|
||||
#define R600_SCISSOR__PA_SC_GENERIC_SCISSOR_BR 16
|
||||
#define R600_SCISSOR__PA_SC_VPORT_SCISSOR_0_TL 17
|
||||
#define R600_SCISSOR__PA_SC_VPORT_SCISSOR_0_BR 18
|
||||
#define R600_SCISSOR_SIZE 19
|
||||
#define R600_SCISSOR_PM4 128
|
||||
|
||||
/* R600_BLEND */
|
||||
#define R600_BLEND__CB_BLEND_RED 0
|
||||
#define R600_BLEND__CB_BLEND_GREEN 1
|
||||
#define R600_BLEND__CB_BLEND_BLUE 2
|
||||
#define R600_BLEND__CB_BLEND_ALPHA 3
|
||||
#define R600_BLEND__CB_BLEND0_CONTROL 4
|
||||
#define R600_BLEND__CB_BLEND1_CONTROL 5
|
||||
#define R600_BLEND__CB_BLEND2_CONTROL 6
|
||||
#define R600_BLEND__CB_BLEND3_CONTROL 7
|
||||
#define R600_BLEND__CB_BLEND4_CONTROL 8
|
||||
#define R600_BLEND__CB_BLEND5_CONTROL 9
|
||||
#define R600_BLEND__CB_BLEND6_CONTROL 10
|
||||
#define R600_BLEND__CB_BLEND7_CONTROL 11
|
||||
#define R600_BLEND__CB_BLEND_CONTROL 12
|
||||
#define R600_BLEND_SIZE 13
|
||||
#define R600_BLEND_PM4 128
|
||||
|
||||
/* R600_DSA */
|
||||
#define R600_DSA__DB_STENCIL_CLEAR 0
|
||||
#define R600_DSA__DB_DEPTH_CLEAR 1
|
||||
#define R600_DSA__SX_ALPHA_TEST_CONTROL 2
|
||||
#define R600_DSA__DB_STENCILREFMASK 3
|
||||
#define R600_DSA__DB_STENCILREFMASK_BF 4
|
||||
#define R600_DSA__SX_ALPHA_REF 5
|
||||
#define R600_DSA__SPI_FOG_FUNC_SCALE 6
|
||||
#define R600_DSA__SPI_FOG_FUNC_BIAS 7
|
||||
#define R600_DSA__SPI_FOG_CNTL 8
|
||||
#define R600_DSA__DB_DEPTH_CONTROL 9
|
||||
#define R600_DSA__DB_SHADER_CONTROL 10
|
||||
#define R600_DSA__DB_RENDER_CONTROL 11
|
||||
#define R600_DSA__DB_RENDER_OVERRIDE 12
|
||||
#define R600_DSA__DB_SRESULTS_COMPARE_STATE1 13
|
||||
#define R600_DSA__DB_PRELOAD_CONTROL 14
|
||||
#define R600_DSA__DB_ALPHA_TO_MASK 15
|
||||
#define R600_DSA_SIZE 16
|
||||
#define R600_DSA_PM4 128
|
||||
|
||||
/* R600_VS_SHADER */
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_0 0
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_1 1
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_2 2
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_3 3
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_4 4
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_5 5
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_6 6
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_7 7
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_8 8
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_9 9
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_10 10
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_11 11
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_12 12
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_13 13
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_14 14
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_15 15
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_16 16
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_17 17
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_18 18
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_19 19
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_20 20
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_21 21
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_22 22
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_23 23
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_24 24
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_25 25
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_26 26
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_27 27
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_28 28
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_29 29
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_30 30
|
||||
#define R600_VS_SHADER__SQ_VTX_SEMANTIC_31 31
|
||||
#define R600_VS_SHADER__SPI_VS_OUT_ID_0 32
|
||||
#define R600_VS_SHADER__SPI_VS_OUT_ID_1 33
|
||||
#define R600_VS_SHADER__SPI_VS_OUT_ID_2 34
|
||||
#define R600_VS_SHADER__SPI_VS_OUT_ID_3 35
|
||||
#define R600_VS_SHADER__SPI_VS_OUT_ID_4 36
|
||||
#define R600_VS_SHADER__SPI_VS_OUT_ID_5 37
|
||||
#define R600_VS_SHADER__SPI_VS_OUT_ID_6 38
|
||||
#define R600_VS_SHADER__SPI_VS_OUT_ID_7 39
|
||||
#define R600_VS_SHADER__SPI_VS_OUT_ID_8 40
|
||||
#define R600_VS_SHADER__SPI_VS_OUT_ID_9 41
|
||||
#define R600_VS_SHADER__SPI_VS_OUT_CONFIG 42
|
||||
#define R600_VS_SHADER__SQ_PGM_START_VS 43
|
||||
#define R600_VS_SHADER__SQ_PGM_RESOURCES_VS 44
|
||||
#define R600_VS_SHADER__SQ_PGM_START_FS 45
|
||||
#define R600_VS_SHADER__SQ_PGM_RESOURCES_FS 46
|
||||
#define R600_VS_SHADER__SQ_PGM_CF_OFFSET_VS 47
|
||||
#define R600_VS_SHADER__SQ_PGM_CF_OFFSET_FS 48
|
||||
#define R600_VS_SHADER_SIZE 49
|
||||
#define R600_VS_SHADER_PM4 128
|
||||
|
||||
/* R600_PS_SHADER */
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_0 0
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_1 1
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_2 2
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_3 3
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_4 4
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_5 5
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_6 6
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_7 7
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_8 8
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_9 9
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_10 10
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_11 11
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_12 12
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_13 13
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_14 14
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_15 15
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_16 16
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_17 17
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_18 18
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_19 19
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_20 20
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_21 21
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_22 22
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_23 23
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_24 24
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_25 25
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_26 26
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_27 27
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_28 28
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_29 29
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_30 30
|
||||
#define R600_PS_SHADER__SPI_PS_INPUT_CNTL_31 31
|
||||
#define R600_PS_SHADER__SPI_PS_IN_CONTROL_0 32
|
||||
#define R600_PS_SHADER__SPI_PS_IN_CONTROL_1 33
|
||||
#define R600_PS_SHADER__SPI_INPUT_Z 34
|
||||
#define R600_PS_SHADER__SQ_PGM_START_PS 35
|
||||
#define R600_PS_SHADER__SQ_PGM_RESOURCES_PS 36
|
||||
#define R600_PS_SHADER__SQ_PGM_EXPORTS_PS 37
|
||||
#define R600_PS_SHADER__SQ_PGM_CF_OFFSET_PS 38
|
||||
#define R600_PS_SHADER_SIZE 39
|
||||
#define R600_PS_SHADER_PM4 128
|
||||
|
||||
/* R600_VS_CBUF */
|
||||
#define R600_VS_CBUF__ALU_CONST_BUFFER_SIZE_VS_0 0
|
||||
#define R600_VS_CBUF__ALU_CONST_CACHE_VS_0 1
|
||||
#define R600_VS_CBUF_SIZE 2
|
||||
#define R600_VS_CBUF_PM4 128
|
||||
|
||||
/* R600_PS_CBUF */
|
||||
#define R600_PS_CBUF__ALU_CONST_BUFFER_SIZE_PS_0 0
|
||||
#define R600_PS_CBUF__ALU_CONST_CACHE_PS_0 1
|
||||
#define R600_PS_CBUF_SIZE 2
|
||||
#define R600_PS_CBUF_PM4 128
|
||||
|
||||
/* R600_PS_CONSTANT */
|
||||
#define R600_PS_CONSTANT__SQ_ALU_CONSTANT0_0 0
|
||||
#define R600_PS_CONSTANT__SQ_ALU_CONSTANT1_0 1
|
||||
#define R600_PS_CONSTANT__SQ_ALU_CONSTANT2_0 2
|
||||
#define R600_PS_CONSTANT__SQ_ALU_CONSTANT3_0 3
|
||||
#define R600_PS_CONSTANT_SIZE 4
|
||||
#define R600_PS_CONSTANT_PM4 128
|
||||
|
||||
/* R600_VS_CONSTANT */
|
||||
#define R600_VS_CONSTANT__SQ_ALU_CONSTANT0_256 0
|
||||
#define R600_VS_CONSTANT__SQ_ALU_CONSTANT1_256 1
|
||||
#define R600_VS_CONSTANT__SQ_ALU_CONSTANT2_256 2
|
||||
#define R600_VS_CONSTANT__SQ_ALU_CONSTANT3_256 3
|
||||
#define R600_VS_CONSTANT_SIZE 4
|
||||
#define R600_VS_CONSTANT_PM4 128
|
||||
|
||||
/* R600_UCP */
|
||||
#define R600_UCP__PA_CL_UCP0_X 0
|
||||
#define R600_UCP__PA_CL_UCP0_Y 1
|
||||
#define R600_UCP__PA_CL_UCP0_Z 2
|
||||
#define R600_UCP__PA_CL_UCP0_W 3
|
||||
#define R600_UCP__PA_CL_UCP1_X 4
|
||||
#define R600_UCP__PA_CL_UCP1_Y 5
|
||||
#define R600_UCP__PA_CL_UCP1_Z 6
|
||||
#define R600_UCP__PA_CL_UCP1_W 7
|
||||
#define R600_UCP__PA_CL_UCP2_X 8
|
||||
#define R600_UCP__PA_CL_UCP2_Y 9
|
||||
#define R600_UCP__PA_CL_UCP2_Z 10
|
||||
#define R600_UCP__PA_CL_UCP2_W 11
|
||||
#define R600_UCP__PA_CL_UCP3_X 12
|
||||
#define R600_UCP__PA_CL_UCP3_Y 13
|
||||
#define R600_UCP__PA_CL_UCP3_Z 14
|
||||
#define R600_UCP__PA_CL_UCP3_W 15
|
||||
#define R600_UCP__PA_CL_UCP4_X 16
|
||||
#define R600_UCP__PA_CL_UCP4_Y 17
|
||||
#define R600_UCP__PA_CL_UCP4_Z 18
|
||||
#define R600_UCP__PA_CL_UCP4_W 19
|
||||
#define R600_UCP__PA_CL_UCP5_X 20
|
||||
#define R600_UCP__PA_CL_UCP5_Y 21
|
||||
#define R600_UCP__PA_CL_UCP5_Z 22
|
||||
#define R600_UCP__PA_CL_UCP5_W 23
|
||||
#define R600_UCP_SIZE 24
|
||||
#define R600_UCP_PM4 128
|
||||
|
||||
/* R600_PS_RESOURCE */
|
||||
#define R600_PS_RESOURCE__RESOURCE0_WORD0 0
|
||||
#define R600_PS_RESOURCE__RESOURCE0_WORD1 1
|
||||
#define R600_PS_RESOURCE__RESOURCE0_WORD2 2
|
||||
#define R600_PS_RESOURCE__RESOURCE0_WORD3 3
|
||||
#define R600_PS_RESOURCE__RESOURCE0_WORD4 4
|
||||
#define R600_PS_RESOURCE__RESOURCE0_WORD5 5
|
||||
#define R600_PS_RESOURCE__RESOURCE0_WORD6 6
|
||||
#define R600_PS_RESOURCE_SIZE 7
|
||||
#define R600_PS_RESOURCE_PM4 128
|
||||
|
||||
/* R600_VS_RESOURCE */
|
||||
#define R600_VS_RESOURCE__RESOURCE160_WORD0 0
|
||||
#define R600_VS_RESOURCE__RESOURCE160_WORD1 1
|
||||
#define R600_VS_RESOURCE__RESOURCE160_WORD2 2
|
||||
#define R600_VS_RESOURCE__RESOURCE160_WORD3 3
|
||||
#define R600_VS_RESOURCE__RESOURCE160_WORD4 4
|
||||
#define R600_VS_RESOURCE__RESOURCE160_WORD5 5
|
||||
#define R600_VS_RESOURCE__RESOURCE160_WORD6 6
|
||||
#define R600_VS_RESOURCE_SIZE 7
|
||||
#define R600_VS_RESOURCE_PM4 128
|
||||
|
||||
/* R600_FS_RESOURCE */
|
||||
#define R600_FS_RESOURCE__RESOURCE320_WORD0 0
|
||||
#define R600_FS_RESOURCE__RESOURCE320_WORD1 1
|
||||
#define R600_FS_RESOURCE__RESOURCE320_WORD2 2
|
||||
#define R600_FS_RESOURCE__RESOURCE320_WORD3 3
|
||||
#define R600_FS_RESOURCE__RESOURCE320_WORD4 4
|
||||
#define R600_FS_RESOURCE__RESOURCE320_WORD5 5
|
||||
#define R600_FS_RESOURCE__RESOURCE320_WORD6 6
|
||||
#define R600_FS_RESOURCE_SIZE 7
|
||||
#define R600_FS_RESOURCE_PM4 128
|
||||
|
||||
/* R600_GS_RESOURCE */
|
||||
#define R600_GS_RESOURCE__RESOURCE336_WORD0 0
|
||||
#define R600_GS_RESOURCE__RESOURCE336_WORD1 1
|
||||
#define R600_GS_RESOURCE__RESOURCE336_WORD2 2
|
||||
#define R600_GS_RESOURCE__RESOURCE336_WORD3 3
|
||||
#define R600_GS_RESOURCE__RESOURCE336_WORD4 4
|
||||
#define R600_GS_RESOURCE__RESOURCE336_WORD5 5
|
||||
#define R600_GS_RESOURCE__RESOURCE336_WORD6 6
|
||||
#define R600_GS_RESOURCE_SIZE 7
|
||||
#define R600_GS_RESOURCE_PM4 128
|
||||
|
||||
/* R600_PS_SAMPLER */
|
||||
#define R600_PS_SAMPLER__SQ_TEX_SAMPLER_WORD0_0 0
|
||||
#define R600_PS_SAMPLER__SQ_TEX_SAMPLER_WORD1_0 1
|
||||
#define R600_PS_SAMPLER__SQ_TEX_SAMPLER_WORD2_0 2
|
||||
#define R600_PS_SAMPLER_SIZE 3
|
||||
#define R600_PS_SAMPLER_PM4 128
|
||||
|
||||
/* R600_VS_SAMPLER */
|
||||
#define R600_VS_SAMPLER__SQ_TEX_SAMPLER_WORD0_18 0
|
||||
#define R600_VS_SAMPLER__SQ_TEX_SAMPLER_WORD1_18 1
|
||||
#define R600_VS_SAMPLER__SQ_TEX_SAMPLER_WORD2_18 2
|
||||
#define R600_VS_SAMPLER_SIZE 3
|
||||
#define R600_VS_SAMPLER_PM4 128
|
||||
|
||||
/* R600_GS_SAMPLER */
|
||||
#define R600_GS_SAMPLER__SQ_TEX_SAMPLER_WORD0_36 0
|
||||
#define R600_GS_SAMPLER__SQ_TEX_SAMPLER_WORD1_36 1
|
||||
#define R600_GS_SAMPLER__SQ_TEX_SAMPLER_WORD2_36 2
|
||||
#define R600_GS_SAMPLER_SIZE 3
|
||||
#define R600_GS_SAMPLER_PM4 128
|
||||
|
||||
/* R600_PS_SAMPLER_BORDER */
|
||||
#define R600_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_RED 0
|
||||
#define R600_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_GREEN 1
|
||||
#define R600_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_BLUE 2
|
||||
#define R600_PS_SAMPLER_BORDER__TD_PS_SAMPLER0_BORDER_ALPHA 3
|
||||
#define R600_PS_SAMPLER_BORDER_SIZE 4
|
||||
#define R600_PS_SAMPLER_BORDER_PM4 128
|
||||
|
||||
/* R600_VS_SAMPLER_BORDER */
|
||||
#define R600_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_RED 0
|
||||
#define R600_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_GREEN 1
|
||||
#define R600_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_BLUE 2
|
||||
#define R600_VS_SAMPLER_BORDER__TD_VS_SAMPLER0_BORDER_ALPHA 3
|
||||
#define R600_VS_SAMPLER_BORDER_SIZE 4
|
||||
#define R600_VS_SAMPLER_BORDER_PM4 128
|
||||
|
||||
/* R600_GS_SAMPLER_BORDER */
|
||||
#define R600_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_RED 0
|
||||
#define R600_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_GREEN 1
|
||||
#define R600_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_BLUE 2
|
||||
#define R600_GS_SAMPLER_BORDER__TD_GS_SAMPLER0_BORDER_ALPHA 3
|
||||
#define R600_GS_SAMPLER_BORDER_SIZE 4
|
||||
#define R600_GS_SAMPLER_BORDER_PM4 128
|
||||
|
||||
/* R600_CB0 */
|
||||
#define R600_CB0__CB_COLOR0_BASE 0
|
||||
#define R600_CB0__CB_COLOR0_INFO 1
|
||||
#define R600_CB0__CB_COLOR0_SIZE 2
|
||||
#define R600_CB0__CB_COLOR0_VIEW 3
|
||||
#define R600_CB0__CB_COLOR0_FRAG 4
|
||||
#define R600_CB0__CB_COLOR0_TILE 5
|
||||
#define R600_CB0__CB_COLOR0_MASK 6
|
||||
#define R600_CB0_SIZE 7
|
||||
#define R600_CB0_PM4 128
|
||||
|
||||
/* R600_CB1 */
|
||||
#define R600_CB1__CB_COLOR1_BASE 0
|
||||
#define R600_CB1__CB_COLOR1_INFO 1
|
||||
#define R600_CB1__CB_COLOR1_SIZE 2
|
||||
#define R600_CB1__CB_COLOR1_VIEW 3
|
||||
#define R600_CB1__CB_COLOR1_FRAG 4
|
||||
#define R600_CB1__CB_COLOR1_TILE 5
|
||||
#define R600_CB1__CB_COLOR1_MASK 6
|
||||
#define R600_CB1_SIZE 7
|
||||
#define R600_CB1_PM4 128
|
||||
|
||||
/* R600_CB2 */
|
||||
#define R600_CB2__CB_COLOR2_BASE 0
|
||||
#define R600_CB2__CB_COLOR2_INFO 1
|
||||
#define R600_CB2__CB_COLOR2_SIZE 2
|
||||
#define R600_CB2__CB_COLOR2_VIEW 3
|
||||
#define R600_CB2__CB_COLOR2_FRAG 4
|
||||
#define R600_CB2__CB_COLOR2_TILE 5
|
||||
#define R600_CB2__CB_COLOR2_MASK 6
|
||||
#define R600_CB2_SIZE 7
|
||||
#define R600_CB2_PM4 128
|
||||
|
||||
/* R600_CB3 */
|
||||
#define R600_CB3__CB_COLOR3_BASE 0
|
||||
#define R600_CB3__CB_COLOR3_INFO 1
|
||||
#define R600_CB3__CB_COLOR3_SIZE 2
|
||||
#define R600_CB3__CB_COLOR3_VIEW 3
|
||||
#define R600_CB3__CB_COLOR3_FRAG 4
|
||||
#define R600_CB3__CB_COLOR3_TILE 5
|
||||
#define R600_CB3__CB_COLOR3_MASK 6
|
||||
#define R600_CB3_SIZE 7
|
||||
#define R600_CB3_PM4 128
|
||||
|
||||
/* R600_CB4 */
|
||||
#define R600_CB4__CB_COLOR4_BASE 0
|
||||
#define R600_CB4__CB_COLOR4_INFO 1
|
||||
#define R600_CB4__CB_COLOR4_SIZE 2
|
||||
#define R600_CB4__CB_COLOR4_VIEW 3
|
||||
#define R600_CB4__CB_COLOR4_FRAG 4
|
||||
#define R600_CB4__CB_COLOR4_TILE 5
|
||||
#define R600_CB4__CB_COLOR4_MASK 6
|
||||
#define R600_CB4_SIZE 7
|
||||
#define R600_CB4_PM4 128
|
||||
|
||||
/* R600_CB5 */
|
||||
#define R600_CB5__CB_COLOR5_BASE 0
|
||||
#define R600_CB5__CB_COLOR5_INFO 1
|
||||
#define R600_CB5__CB_COLOR5_SIZE 2
|
||||
#define R600_CB5__CB_COLOR5_VIEW 3
|
||||
#define R600_CB5__CB_COLOR5_FRAG 4
|
||||
#define R600_CB5__CB_COLOR5_TILE 5
|
||||
#define R600_CB5__CB_COLOR5_MASK 6
|
||||
#define R600_CB5_SIZE 7
|
||||
#define R600_CB5_PM4 128
|
||||
|
||||
/* R600_CB6 */
|
||||
#define R600_CB6__CB_COLOR6_BASE 0
|
||||
#define R600_CB6__CB_COLOR6_INFO 1
|
||||
#define R600_CB6__CB_COLOR6_SIZE 2
|
||||
#define R600_CB6__CB_COLOR6_VIEW 3
|
||||
#define R600_CB6__CB_COLOR6_FRAG 4
|
||||
#define R600_CB6__CB_COLOR6_TILE 5
|
||||
#define R600_CB6__CB_COLOR6_MASK 6
|
||||
#define R600_CB6_SIZE 7
|
||||
#define R600_CB6_PM4 128
|
||||
|
||||
/* R600_CB7 */
|
||||
#define R600_CB7__CB_COLOR7_BASE 0
|
||||
#define R600_CB7__CB_COLOR7_INFO 1
|
||||
#define R600_CB7__CB_COLOR7_SIZE 2
|
||||
#define R600_CB7__CB_COLOR7_VIEW 3
|
||||
#define R600_CB7__CB_COLOR7_FRAG 4
|
||||
#define R600_CB7__CB_COLOR7_TILE 5
|
||||
#define R600_CB7__CB_COLOR7_MASK 6
|
||||
#define R600_CB7_SIZE 7
|
||||
#define R600_CB7_PM4 128
|
||||
|
||||
/* R600_DB */
|
||||
#define R600_DB__DB_DEPTH_BASE 0
|
||||
#define R600_DB__DB_DEPTH_SIZE 1
|
||||
#define R600_DB__DB_DEPTH_VIEW 2
|
||||
#define R600_DB__DB_DEPTH_INFO 3
|
||||
#define R600_DB__DB_HTILE_SURFACE 4
|
||||
#define R600_DB__DB_PREFETCH_LIMIT 5
|
||||
#define R600_DB_SIZE 6
|
||||
#define R600_DB_PM4 128
|
||||
|
||||
/* R600_VGT */
|
||||
#define R600_VGT__VGT_PRIMITIVE_TYPE 0
|
||||
#define R600_VGT__VGT_MAX_VTX_INDX 1
|
||||
#define R600_VGT__VGT_MIN_VTX_INDX 2
|
||||
#define R600_VGT__VGT_INDX_OFFSET 3
|
||||
#define R600_VGT__VGT_MULTI_PRIM_IB_RESET_INDX 4
|
||||
#define R600_VGT__VGT_DMA_INDEX_TYPE 5
|
||||
#define R600_VGT__VGT_PRIMITIVEID_EN 6
|
||||
#define R600_VGT__VGT_DMA_NUM_INSTANCES 7
|
||||
#define R600_VGT__VGT_MULTI_PRIM_IB_RESET_EN 8
|
||||
#define R600_VGT__VGT_INSTANCE_STEP_RATE_0 9
|
||||
#define R600_VGT__VGT_INSTANCE_STEP_RATE_1 10
|
||||
#define R600_VGT_SIZE 11
|
||||
#define R600_VGT_PM4 128
|
||||
|
||||
/* R600_DRAW */
|
||||
#define R600_DRAW__VGT_NUM_INDICES 0
|
||||
#define R600_DRAW__VGT_DMA_BASE_HI 1
|
||||
#define R600_DRAW__VGT_DMA_BASE 2
|
||||
#define R600_DRAW__VGT_DRAW_INITIATOR 3
|
||||
#define R600_DRAW_SIZE 4
|
||||
#define R600_DRAW_PM4 128
|
||||
|
||||
/* R600_VGT_EVENT */
|
||||
#define R600_VGT_EVENT__VGT_EVENT_INITIATOR 0
|
||||
#define R600_VGT_EVENT_SIZE 1
|
||||
#define R600_VGT_EVENT_PM4 128
|
||||
|
||||
/* R600_CB_FLUSH */
|
||||
#define R600_CB_FLUSH_SIZE 0
|
||||
#define R600_CB_FLUSH_PM4 128
|
||||
|
||||
/* R600_DB_FLUSH */
|
||||
#define R600_DB_FLUSH_SIZE 0
|
||||
#define R600_DB_FLUSH_PM4 128
|
||||
|
||||
@@ -91,10 +91,17 @@ softpipe_destroy( struct pipe_context *pipe )
|
||||
if (softpipe->draw)
|
||||
draw_destroy( softpipe->draw );
|
||||
|
||||
softpipe->quad.shade->destroy( softpipe->quad.shade );
|
||||
softpipe->quad.depth_test->destroy( softpipe->quad.depth_test );
|
||||
softpipe->quad.blend->destroy( softpipe->quad.blend );
|
||||
softpipe->quad.pstipple->destroy( softpipe->quad.pstipple );
|
||||
if (softpipe->quad.shade)
|
||||
softpipe->quad.shade->destroy( softpipe->quad.shade );
|
||||
|
||||
if (softpipe->quad.depth_test)
|
||||
softpipe->quad.depth_test->destroy( softpipe->quad.depth_test );
|
||||
|
||||
if (softpipe->quad.blend)
|
||||
softpipe->quad.blend->destroy( softpipe->quad.blend );
|
||||
|
||||
if (softpipe->quad.pstipple)
|
||||
softpipe->quad.pstipple->destroy( softpipe->quad.pstipple );
|
||||
|
||||
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
|
||||
sp_destroy_tile_cache(softpipe->cbuf_cache[i]);
|
||||
@@ -105,8 +112,8 @@ softpipe_destroy( struct pipe_context *pipe )
|
||||
pipe_surface_reference(&softpipe->framebuffer.zsbuf, NULL);
|
||||
|
||||
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
|
||||
sp_destroy_tex_tile_cache(softpipe->tex_cache[i]);
|
||||
pipe_sampler_view_reference(&softpipe->sampler_views[i], NULL);
|
||||
sp_destroy_tex_tile_cache(softpipe->fragment_tex_cache[i]);
|
||||
pipe_sampler_view_reference(&softpipe->fragment_sampler_views[i], NULL);
|
||||
}
|
||||
|
||||
for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
|
||||
@@ -174,8 +181,8 @@ softpipe_is_resource_referenced( struct pipe_context *pipe,
|
||||
|
||||
/* check if any of the tex_cache textures are this texture */
|
||||
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
|
||||
if (softpipe->tex_cache[i] &&
|
||||
softpipe->tex_cache[i]->texture == texture)
|
||||
if (softpipe->fragment_tex_cache[i] &&
|
||||
softpipe->fragment_tex_cache[i]->texture == texture)
|
||||
return PIPE_REFERENCED_FOR_READ;
|
||||
}
|
||||
for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
|
||||
@@ -262,13 +269,22 @@ softpipe_create_context( struct pipe_screen *screen,
|
||||
softpipe->cbuf_cache[i] = sp_create_tile_cache( &softpipe->pipe );
|
||||
softpipe->zsbuf_cache = sp_create_tile_cache( &softpipe->pipe );
|
||||
|
||||
for (i = 0; i < PIPE_MAX_SAMPLERS; i++)
|
||||
softpipe->tex_cache[i] = sp_create_tex_tile_cache( &softpipe->pipe );
|
||||
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
|
||||
softpipe->fragment_tex_cache[i] = sp_create_tex_tile_cache( &softpipe->pipe );
|
||||
if (!softpipe->fragment_tex_cache[i])
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
|
||||
softpipe->vertex_tex_cache[i] = sp_create_tex_tile_cache( &softpipe->pipe );
|
||||
if (!softpipe->vertex_tex_cache[i])
|
||||
goto fail;
|
||||
}
|
||||
|
||||
for (i = 0; i < PIPE_MAX_GEOMETRY_SAMPLERS; i++) {
|
||||
softpipe->geometry_tex_cache[i] = sp_create_tex_tile_cache( &softpipe->pipe );
|
||||
if (!softpipe->geometry_tex_cache[i])
|
||||
goto fail;
|
||||
}
|
||||
|
||||
softpipe->fs_machine = tgsi_exec_machine_create();
|
||||
|
||||
@@ -77,7 +77,7 @@ struct softpipe_context {
|
||||
struct pipe_framebuffer_state framebuffer;
|
||||
struct pipe_poly_stipple poly_stipple;
|
||||
struct pipe_scissor_state scissor;
|
||||
struct pipe_sampler_view *sampler_views[PIPE_MAX_SAMPLERS];
|
||||
struct pipe_sampler_view *fragment_sampler_views[PIPE_MAX_SAMPLERS];
|
||||
struct pipe_sampler_view *vertex_sampler_views[PIPE_MAX_VERTEX_SAMPLERS];
|
||||
struct pipe_sampler_view *geometry_sampler_views[PIPE_MAX_GEOMETRY_SAMPLERS];
|
||||
struct pipe_viewport_state viewport;
|
||||
@@ -174,7 +174,7 @@ struct softpipe_context {
|
||||
struct softpipe_tile_cache *zsbuf_cache;
|
||||
|
||||
unsigned tex_timestamp;
|
||||
struct softpipe_tex_tile_cache *tex_cache[PIPE_MAX_SAMPLERS];
|
||||
struct softpipe_tex_tile_cache *fragment_tex_cache[PIPE_MAX_SAMPLERS];
|
||||
struct softpipe_tex_tile_cache *vertex_tex_cache[PIPE_MAX_VERTEX_SAMPLERS];
|
||||
struct softpipe_tex_tile_cache *geometry_tex_cache[PIPE_MAX_GEOMETRY_SAMPLERS];
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ softpipe_flush( struct pipe_context *pipe,
|
||||
|
||||
if (flags & PIPE_FLUSH_TEXTURE_CACHE) {
|
||||
for (i = 0; i < softpipe->num_sampler_views; i++) {
|
||||
sp_flush_tex_tile_cache(softpipe->tex_cache[i]);
|
||||
sp_flush_tex_tile_cache(softpipe->fragment_tex_cache[i]);
|
||||
}
|
||||
for (i = 0; i < softpipe->num_vertex_sampler_views; i++) {
|
||||
sp_flush_tex_tile_cache(softpipe->vertex_tex_cache[i]);
|
||||
|
||||
@@ -200,8 +200,8 @@ update_tgsi_samplers( struct softpipe_context *softpipe )
|
||||
softpipe_reset_sampler_variants( softpipe );
|
||||
|
||||
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
|
||||
struct softpipe_tex_tile_cache *tc = softpipe->tex_cache[i];
|
||||
if (tc->texture) {
|
||||
struct softpipe_tex_tile_cache *tc = softpipe->fragment_tex_cache[i];
|
||||
if (tc && tc->texture) {
|
||||
struct softpipe_resource *spt = softpipe_resource(tc->texture);
|
||||
if (spt->timestamp != tc->timestamp) {
|
||||
sp_tex_tile_cache_validate_texture( tc );
|
||||
@@ -216,7 +216,7 @@ update_tgsi_samplers( struct softpipe_context *softpipe )
|
||||
for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) {
|
||||
struct softpipe_tex_tile_cache *tc = softpipe->vertex_tex_cache[i];
|
||||
|
||||
if (tc->texture) {
|
||||
if (tc && tc->texture) {
|
||||
struct softpipe_resource *spt = softpipe_resource(tc->texture);
|
||||
|
||||
if (spt->timestamp != tc->timestamp) {
|
||||
@@ -229,7 +229,7 @@ update_tgsi_samplers( struct softpipe_context *softpipe )
|
||||
for (i = 0; i < PIPE_MAX_GEOMETRY_SAMPLERS; i++) {
|
||||
struct softpipe_tex_tile_cache *tc = softpipe->geometry_tex_cache[i];
|
||||
|
||||
if (tc->texture) {
|
||||
if (tc && tc->texture) {
|
||||
struct softpipe_resource *spt = softpipe_resource(tc->texture);
|
||||
|
||||
if (spt->timestamp != tc->timestamp) {
|
||||
|
||||
@@ -67,8 +67,8 @@ softpipe_create_sampler_state(struct pipe_context *pipe,
|
||||
|
||||
|
||||
static void
|
||||
softpipe_bind_sampler_states(struct pipe_context *pipe,
|
||||
unsigned num, void **sampler)
|
||||
softpipe_bind_fragment_sampler_states(struct pipe_context *pipe,
|
||||
unsigned num, void **sampler)
|
||||
{
|
||||
struct softpipe_context *softpipe = softpipe_context(pipe);
|
||||
unsigned i;
|
||||
@@ -181,9 +181,9 @@ softpipe_sampler_view_destroy(struct pipe_context *pipe,
|
||||
|
||||
|
||||
static void
|
||||
softpipe_set_sampler_views(struct pipe_context *pipe,
|
||||
unsigned num,
|
||||
struct pipe_sampler_view **views)
|
||||
softpipe_set_fragment_sampler_views(struct pipe_context *pipe,
|
||||
unsigned num,
|
||||
struct pipe_sampler_view **views)
|
||||
{
|
||||
struct softpipe_context *softpipe = softpipe_context(pipe);
|
||||
uint i;
|
||||
@@ -192,7 +192,8 @@ softpipe_set_sampler_views(struct pipe_context *pipe,
|
||||
|
||||
/* Check for no-op */
|
||||
if (num == softpipe->num_sampler_views &&
|
||||
!memcmp(softpipe->sampler_views, views, num * sizeof(struct pipe_sampler_view *)))
|
||||
!memcmp(softpipe->fragment_sampler_views, views,
|
||||
num * sizeof(struct pipe_sampler_view *)))
|
||||
return;
|
||||
|
||||
draw_flush(softpipe->draw);
|
||||
@@ -200,8 +201,8 @@ softpipe_set_sampler_views(struct pipe_context *pipe,
|
||||
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
|
||||
struct pipe_sampler_view *view = i < num ? views[i] : NULL;
|
||||
|
||||
pipe_sampler_view_reference(&softpipe->sampler_views[i], view);
|
||||
sp_tex_tile_cache_set_sampler_view(softpipe->tex_cache[i], view);
|
||||
pipe_sampler_view_reference(&softpipe->fragment_sampler_views[i], view);
|
||||
sp_tex_tile_cache_set_sampler_view(softpipe->fragment_tex_cache[i], view);
|
||||
}
|
||||
|
||||
softpipe->num_sampler_views = num;
|
||||
@@ -290,10 +291,9 @@ static struct sp_sampler_variant *
|
||||
get_sampler_variant( unsigned unit,
|
||||
struct sp_sampler *sampler,
|
||||
struct pipe_sampler_view *view,
|
||||
struct pipe_resource *resource,
|
||||
unsigned processor )
|
||||
{
|
||||
struct softpipe_resource *sp_texture = softpipe_resource(resource);
|
||||
struct softpipe_resource *sp_texture = softpipe_resource(view->texture);
|
||||
struct sp_sampler_variant *v = NULL;
|
||||
union sp_sampler_key key;
|
||||
|
||||
@@ -343,68 +343,47 @@ softpipe_reset_sampler_variants(struct softpipe_context *softpipe)
|
||||
*/
|
||||
for (i = 0; i <= softpipe->vs->max_sampler; i++) {
|
||||
if (softpipe->vertex_samplers[i]) {
|
||||
struct pipe_resource *texture = NULL;
|
||||
|
||||
if (softpipe->vertex_sampler_views[i]) {
|
||||
texture = softpipe->vertex_sampler_views[i]->texture;
|
||||
}
|
||||
|
||||
softpipe->tgsi.vert_samplers_list[i] =
|
||||
get_sampler_variant( i,
|
||||
sp_sampler(softpipe->vertex_samplers[i]),
|
||||
softpipe->vertex_sampler_views[i],
|
||||
texture,
|
||||
TGSI_PROCESSOR_VERTEX );
|
||||
|
||||
sp_sampler_variant_bind_texture( softpipe->tgsi.vert_samplers_list[i],
|
||||
softpipe->vertex_tex_cache[i],
|
||||
texture );
|
||||
sp_sampler_variant_bind_view( softpipe->tgsi.vert_samplers_list[i],
|
||||
softpipe->vertex_tex_cache[i],
|
||||
softpipe->vertex_sampler_views[i] );
|
||||
}
|
||||
}
|
||||
|
||||
if (softpipe->gs) {
|
||||
for (i = 0; i <= softpipe->gs->max_sampler; i++) {
|
||||
if (softpipe->geometry_samplers[i]) {
|
||||
struct pipe_resource *texture = NULL;
|
||||
|
||||
if (softpipe->geometry_sampler_views[i]) {
|
||||
texture = softpipe->geometry_sampler_views[i]->texture;
|
||||
}
|
||||
|
||||
softpipe->tgsi.geom_samplers_list[i] =
|
||||
get_sampler_variant(
|
||||
i,
|
||||
sp_sampler(softpipe->geometry_samplers[i]),
|
||||
softpipe->geometry_sampler_views[i],
|
||||
texture,
|
||||
TGSI_PROCESSOR_GEOMETRY );
|
||||
|
||||
sp_sampler_variant_bind_texture(
|
||||
sp_sampler_variant_bind_view(
|
||||
softpipe->tgsi.geom_samplers_list[i],
|
||||
softpipe->geometry_tex_cache[i],
|
||||
texture );
|
||||
softpipe->geometry_sampler_views[i] );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i <= softpipe->fs->info.file_max[TGSI_FILE_SAMPLER]; i++) {
|
||||
if (softpipe->sampler[i]) {
|
||||
struct pipe_resource *texture = NULL;
|
||||
|
||||
if (softpipe->sampler_views[i]) {
|
||||
texture = softpipe->sampler_views[i]->texture;
|
||||
}
|
||||
|
||||
softpipe->tgsi.frag_samplers_list[i] =
|
||||
get_sampler_variant( i,
|
||||
sp_sampler(softpipe->sampler[i]),
|
||||
softpipe->sampler_views[i],
|
||||
texture,
|
||||
softpipe->fragment_sampler_views[i],
|
||||
TGSI_PROCESSOR_FRAGMENT );
|
||||
|
||||
sp_sampler_variant_bind_texture( softpipe->tgsi.frag_samplers_list[i],
|
||||
softpipe->tex_cache[i],
|
||||
texture );
|
||||
sp_sampler_variant_bind_view( softpipe->tgsi.frag_samplers_list[i],
|
||||
softpipe->fragment_tex_cache[i],
|
||||
softpipe->fragment_sampler_views[i] );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -429,12 +408,12 @@ void
|
||||
softpipe_init_sampler_funcs(struct pipe_context *pipe)
|
||||
{
|
||||
pipe->create_sampler_state = softpipe_create_sampler_state;
|
||||
pipe->bind_fragment_sampler_states = softpipe_bind_sampler_states;
|
||||
pipe->bind_fragment_sampler_states = softpipe_bind_fragment_sampler_states;
|
||||
pipe->bind_vertex_sampler_states = softpipe_bind_vertex_sampler_states;
|
||||
pipe->bind_geometry_sampler_states = softpipe_bind_geometry_sampler_states;
|
||||
pipe->delete_sampler_state = softpipe_delete_sampler_state;
|
||||
|
||||
pipe->set_fragment_sampler_views = softpipe_set_sampler_views;
|
||||
pipe->set_fragment_sampler_views = softpipe_set_fragment_sampler_views;
|
||||
pipe->set_vertex_sampler_views = softpipe_set_vertex_sampler_views;
|
||||
pipe->set_geometry_sampler_views = softpipe_set_geometry_sampler_views;
|
||||
|
||||
|
||||
@@ -550,7 +550,7 @@ compute_lambda_1d(const struct sp_sampler_variant *samp,
|
||||
const float t[QUAD_SIZE],
|
||||
const float p[QUAD_SIZE])
|
||||
{
|
||||
const struct pipe_resource *texture = samp->texture;
|
||||
const struct pipe_resource *texture = samp->view->texture;
|
||||
float dsdx = fabsf(s[QUAD_BOTTOM_RIGHT] - s[QUAD_BOTTOM_LEFT]);
|
||||
float dsdy = fabsf(s[QUAD_TOP_LEFT] - s[QUAD_BOTTOM_LEFT]);
|
||||
float rho = MAX2(dsdx, dsdy) * texture->width0;
|
||||
@@ -565,7 +565,7 @@ compute_lambda_2d(const struct sp_sampler_variant *samp,
|
||||
const float t[QUAD_SIZE],
|
||||
const float p[QUAD_SIZE])
|
||||
{
|
||||
const struct pipe_resource *texture = samp->texture;
|
||||
const struct pipe_resource *texture = samp->view->texture;
|
||||
float dsdx = fabsf(s[QUAD_BOTTOM_RIGHT] - s[QUAD_BOTTOM_LEFT]);
|
||||
float dsdy = fabsf(s[QUAD_TOP_LEFT] - s[QUAD_BOTTOM_LEFT]);
|
||||
float dtdx = fabsf(t[QUAD_BOTTOM_RIGHT] - t[QUAD_BOTTOM_LEFT]);
|
||||
@@ -584,7 +584,7 @@ compute_lambda_3d(const struct sp_sampler_variant *samp,
|
||||
const float t[QUAD_SIZE],
|
||||
const float p[QUAD_SIZE])
|
||||
{
|
||||
const struct pipe_resource *texture = samp->texture;
|
||||
const struct pipe_resource *texture = samp->view->texture;
|
||||
float dsdx = fabsf(s[QUAD_BOTTOM_RIGHT] - s[QUAD_BOTTOM_LEFT]);
|
||||
float dsdy = fabsf(s[QUAD_TOP_LEFT] - s[QUAD_BOTTOM_LEFT]);
|
||||
float dtdx = fabsf(t[QUAD_BOTTOM_RIGHT] - t[QUAD_BOTTOM_LEFT]);
|
||||
@@ -654,7 +654,7 @@ static INLINE const float *
|
||||
get_texel_2d(const struct sp_sampler_variant *samp,
|
||||
union tex_tile_address addr, int x, int y)
|
||||
{
|
||||
const struct pipe_resource *texture = samp->texture;
|
||||
const struct pipe_resource *texture = samp->view->texture;
|
||||
unsigned level = addr.bits.level;
|
||||
|
||||
if (x < 0 || x >= (int) u_minify(texture->width0, level) ||
|
||||
@@ -747,7 +747,7 @@ static INLINE const float *
|
||||
get_texel_3d(const struct sp_sampler_variant *samp,
|
||||
union tex_tile_address addr, int x, int y, int z)
|
||||
{
|
||||
const struct pipe_resource *texture = samp->texture;
|
||||
const struct pipe_resource *texture = samp->view->texture;
|
||||
unsigned level = addr.bits.level;
|
||||
|
||||
if (x < 0 || x >= (int) u_minify(texture->width0, level) ||
|
||||
@@ -959,7 +959,7 @@ img_filter_1d_nearest(struct tgsi_sampler *tgsi_sampler,
|
||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||
{
|
||||
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||
const struct pipe_resource *texture = samp->texture;
|
||||
const struct pipe_resource *texture = samp->view->texture;
|
||||
unsigned level0, j;
|
||||
int width;
|
||||
int x[4];
|
||||
@@ -999,7 +999,7 @@ img_filter_2d_nearest(struct tgsi_sampler *tgsi_sampler,
|
||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||
{
|
||||
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||
const struct pipe_resource *texture = samp->texture;
|
||||
const struct pipe_resource *texture = samp->view->texture;
|
||||
unsigned level0, j;
|
||||
int width, height;
|
||||
int x[4], y[4];
|
||||
@@ -1051,7 +1051,7 @@ img_filter_cube_nearest(struct tgsi_sampler *tgsi_sampler,
|
||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||
{
|
||||
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||
const struct pipe_resource *texture = samp->texture;
|
||||
const struct pipe_resource *texture = samp->view->texture;
|
||||
const unsigned *faces = samp->faces; /* zero when not cube-mapping */
|
||||
unsigned level0, j;
|
||||
int width, height;
|
||||
@@ -1095,7 +1095,7 @@ img_filter_3d_nearest(struct tgsi_sampler *tgsi_sampler,
|
||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||
{
|
||||
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||
const struct pipe_resource *texture = samp->texture;
|
||||
const struct pipe_resource *texture = samp->view->texture;
|
||||
unsigned level0, j;
|
||||
int width, height, depth;
|
||||
int x[4], y[4], z[4];
|
||||
@@ -1137,7 +1137,7 @@ img_filter_1d_linear(struct tgsi_sampler *tgsi_sampler,
|
||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||
{
|
||||
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||
const struct pipe_resource *texture = samp->texture;
|
||||
const struct pipe_resource *texture = samp->view->texture;
|
||||
unsigned level0, j;
|
||||
int width;
|
||||
int x0[4], x1[4];
|
||||
@@ -1177,7 +1177,7 @@ img_filter_2d_linear(struct tgsi_sampler *tgsi_sampler,
|
||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||
{
|
||||
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||
const struct pipe_resource *texture = samp->texture;
|
||||
const struct pipe_resource *texture = samp->view->texture;
|
||||
unsigned level0, j;
|
||||
int width, height;
|
||||
int x0[4], y0[4], x1[4], y1[4];
|
||||
@@ -1224,7 +1224,7 @@ img_filter_cube_linear(struct tgsi_sampler *tgsi_sampler,
|
||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||
{
|
||||
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||
const struct pipe_resource *texture = samp->texture;
|
||||
const struct pipe_resource *texture = samp->view->texture;
|
||||
const unsigned *faces = samp->faces; /* zero when not cube-mapping */
|
||||
unsigned level0, j;
|
||||
int width, height;
|
||||
@@ -1273,7 +1273,7 @@ img_filter_3d_linear(struct tgsi_sampler *tgsi_sampler,
|
||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||
{
|
||||
const struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||
const struct pipe_resource *texture = samp->texture;
|
||||
const struct pipe_resource *texture = samp->view->texture;
|
||||
unsigned level0, j;
|
||||
int width, height, depth;
|
||||
int x0[4], x1[4], y0[4], y1[4], z0[4], z1[4];
|
||||
@@ -1349,7 +1349,7 @@ mip_filter_linear(struct tgsi_sampler *tgsi_sampler,
|
||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||
{
|
||||
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||
const struct pipe_resource *texture = samp->texture;
|
||||
const struct pipe_resource *texture = samp->view->texture;
|
||||
int level0;
|
||||
float lambda;
|
||||
float lod[QUAD_SIZE];
|
||||
@@ -1416,7 +1416,7 @@ mip_filter_nearest(struct tgsi_sampler *tgsi_sampler,
|
||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||
{
|
||||
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||
const struct pipe_resource *texture = samp->texture;
|
||||
const struct pipe_resource *texture = samp->view->texture;
|
||||
float lambda;
|
||||
float lod[QUAD_SIZE];
|
||||
|
||||
@@ -1500,7 +1500,7 @@ mip_filter_linear_2d_linear_repeat_POT(
|
||||
float rgba[NUM_CHANNELS][QUAD_SIZE])
|
||||
{
|
||||
struct sp_sampler_variant *samp = sp_sampler_variant(tgsi_sampler);
|
||||
const struct pipe_resource *texture = samp->texture;
|
||||
const struct pipe_resource *texture = samp->view->texture;
|
||||
int level0;
|
||||
float lambda;
|
||||
float lod[QUAD_SIZE];
|
||||
@@ -1990,13 +1990,14 @@ get_img_filter(const union sp_sampler_key key,
|
||||
* Bind the given texture object and texture cache to the sampler variant.
|
||||
*/
|
||||
void
|
||||
sp_sampler_variant_bind_texture( struct sp_sampler_variant *samp,
|
||||
struct softpipe_tex_tile_cache *tex_cache,
|
||||
const struct pipe_resource *texture )
|
||||
sp_sampler_variant_bind_view( struct sp_sampler_variant *samp,
|
||||
struct softpipe_tex_tile_cache *tex_cache,
|
||||
const struct pipe_sampler_view *view )
|
||||
{
|
||||
const struct pipe_sampler_state *sampler = samp->sampler;
|
||||
const struct pipe_resource *texture = view->texture;
|
||||
|
||||
samp->texture = texture;
|
||||
samp->view = view;
|
||||
samp->cache = tex_cache;
|
||||
samp->xpot = util_unsigned_logbase2( texture->width0 );
|
||||
samp->ypot = util_unsigned_logbase2( texture->height0 );
|
||||
|
||||
@@ -89,7 +89,7 @@ struct sp_sampler_variant
|
||||
|
||||
/* Currently bound texture:
|
||||
*/
|
||||
const struct pipe_resource *texture;
|
||||
const struct pipe_sampler_view *view;
|
||||
struct softpipe_tex_tile_cache *cache;
|
||||
|
||||
unsigned processor;
|
||||
@@ -132,9 +132,9 @@ struct sp_sampler_variant *
|
||||
sp_create_sampler_variant( const struct pipe_sampler_state *sampler,
|
||||
const union sp_sampler_key key );
|
||||
|
||||
void sp_sampler_variant_bind_texture( struct sp_sampler_variant *variant,
|
||||
struct softpipe_tex_tile_cache *tex_cache,
|
||||
const struct pipe_resource *tex );
|
||||
void sp_sampler_variant_bind_view( struct sp_sampler_variant *variant,
|
||||
struct softpipe_tex_tile_cache *tex_cache,
|
||||
const struct pipe_sampler_view *view );
|
||||
|
||||
void sp_sampler_variant_destroy( struct sp_sampler_variant * );
|
||||
|
||||
|
||||
@@ -256,11 +256,16 @@ struct GalliumDXGIAdapter
|
||||
{
|
||||
this->parent = factory;
|
||||
|
||||
/* FIXME handler should be static */
|
||||
handler.invalid_surface = handle_invalid_surface;
|
||||
handler.new_drm_screen = dxgi_loader_create_drm_screen;
|
||||
handler.new_sw_screen = dxgi_loader_create_sw_screen;
|
||||
display = platform->create_display(dpy, &handler, this);
|
||||
platform->set_event_handler(&handler);
|
||||
|
||||
display = platform->create_display(dpy, FALSE, this);
|
||||
if(!display)
|
||||
display = platform->create_display(dpy, TRUE, this);
|
||||
if(!display)
|
||||
throw E_FAIL;
|
||||
memset(&desc, 0, sizeof(desc));
|
||||
std::string s = std::string("GalliumD3D on ") + display->screen->get_name(display->screen) + " by " + display->screen->get_vendor(display->screen);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -123,8 +123,12 @@ endif
|
||||
|
||||
# OpenGL state tracker
|
||||
GL_CPPFLAGS := -I$(TOP)/src/mesa $(API_DEFINES)
|
||||
# cannot not link to $(GL_LIB) as the app might want GLES
|
||||
ifeq ($(SHARED_GLAPI),1)
|
||||
GL_SYS := $(DRI_LIB_DEPS) -l$(GLAPI_LIB)
|
||||
else
|
||||
# cannot link to $(GL_LIB) as the app might want GL or GLES
|
||||
GL_SYS := $(DRI_LIB_DEPS)
|
||||
endif
|
||||
GL_LIBS := $(TOP)/src/mesa/libmesagallium.a
|
||||
|
||||
# OpenVG state tracker
|
||||
|
||||
@@ -66,9 +66,6 @@ graw_create_window_and_screen( int x,
|
||||
root = RootWindow( graw.display, scrnum );
|
||||
|
||||
|
||||
if (format != PIPE_FORMAT_R8G8B8A8_UNORM)
|
||||
goto fail;
|
||||
|
||||
if (graw.display == NULL)
|
||||
goto fail;
|
||||
|
||||
@@ -88,6 +85,23 @@ graw_create_window_and_screen( int x,
|
||||
exit(1);
|
||||
}
|
||||
|
||||
/* See if the requirested pixel format matches the visual */
|
||||
if (visinfo->red_mask == 0xff0000 &&
|
||||
visinfo->green_mask == 0xff00 &&
|
||||
visinfo->blue_mask == 0xff) {
|
||||
if (format != PIPE_FORMAT_B8G8R8A8_UNORM)
|
||||
goto fail;
|
||||
}
|
||||
else if (visinfo->red_mask == 0xff &&
|
||||
visinfo->green_mask == 0xff00 &&
|
||||
visinfo->blue_mask == 0xff0000) {
|
||||
if (format != PIPE_FORMAT_R8G8B8A8_UNORM)
|
||||
goto fail;
|
||||
}
|
||||
else {
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* window attributes */
|
||||
attr.background_pixel = 0;
|
||||
attr.border_pixel = 0;
|
||||
|
||||
@@ -60,6 +60,10 @@ GL_LIB_DEPS += $(LLVM_LIBS)
|
||||
LDFLAGS += $(LLVM_LDFLAGS)
|
||||
endif
|
||||
|
||||
ifeq ($(SHARED_GLAPI),1)
|
||||
GL_LIB_DEPS := -L$(TOP)/$(LIB_DIR) -l$(GLAPI_LIB) $(GL_LIB_DEPS)
|
||||
endif
|
||||
|
||||
|
||||
.SUFFIXES : .cpp
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* any utility code, just the graw interface and gallium.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "state_tracker/graw.h"
|
||||
#include "pipe/p_screen.h"
|
||||
#include "pipe/p_context.h"
|
||||
@@ -48,16 +49,17 @@ static void init( void )
|
||||
* Also, no easy way of querying supported formats if the screen
|
||||
* cannot be created first.
|
||||
*/
|
||||
for (i = 0;
|
||||
window == NULL && formats[i] != PIPE_FORMAT_NONE;
|
||||
i++) {
|
||||
|
||||
screen = graw_create_window_and_screen(0,0,300,300,
|
||||
for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) {
|
||||
screen = graw_create_window_and_screen(0, 0, 300, 300,
|
||||
formats[i],
|
||||
&window);
|
||||
if (window && screen)
|
||||
break;
|
||||
}
|
||||
if (!screen || !window) {
|
||||
fprintf(stderr, "Unable to create window\n");
|
||||
exit(1);
|
||||
}
|
||||
if (window == NULL)
|
||||
exit(2);
|
||||
|
||||
ctx = screen->context_create(screen, NULL);
|
||||
if (ctx == NULL)
|
||||
|
||||
@@ -433,15 +433,18 @@ static void init( void )
|
||||
* Also, no easy way of querying supported formats if the screen
|
||||
* cannot be created first.
|
||||
*/
|
||||
for (i = 0;
|
||||
window == NULL && formats[i] != PIPE_FORMAT_NONE;
|
||||
i++) {
|
||||
|
||||
screen = graw_create_window_and_screen(0,0,WIDTH,HEIGHT,
|
||||
for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) {
|
||||
screen = graw_create_window_and_screen(0, 0, 300, 300,
|
||||
formats[i],
|
||||
&window);
|
||||
if (window && screen)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!screen || !window) {
|
||||
fprintf(stderr, "Unable to create window\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ctx = screen->context_create(screen, NULL);
|
||||
if (ctx == NULL)
|
||||
exit(3);
|
||||
|
||||
@@ -497,15 +497,18 @@ static void init( void )
|
||||
* Also, no easy way of querying supported formats if the screen
|
||||
* cannot be created first.
|
||||
*/
|
||||
for (i = 0;
|
||||
window == NULL && formats[i] != PIPE_FORMAT_NONE;
|
||||
i++) {
|
||||
|
||||
screen = graw_create_window_and_screen(0,0,WIDTH,HEIGHT,
|
||||
for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) {
|
||||
screen = graw_create_window_and_screen(0, 0, 300, 300,
|
||||
formats[i],
|
||||
&window);
|
||||
if (window && screen)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!screen || !window) {
|
||||
fprintf(stderr, "Unable to create window\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ctx = screen->context_create(screen, NULL);
|
||||
if (ctx == NULL)
|
||||
exit(3);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* any utility code, just the graw interface and gallium.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "state_tracker/graw.h"
|
||||
#include "pipe/p_screen.h"
|
||||
#include "pipe/p_context.h"
|
||||
@@ -303,15 +304,18 @@ static void init( void )
|
||||
* Also, no easy way of querying supported formats if the screen
|
||||
* cannot be created first.
|
||||
*/
|
||||
for (i = 0;
|
||||
window == NULL && formats[i] != PIPE_FORMAT_NONE;
|
||||
i++) {
|
||||
|
||||
screen = graw_create_window_and_screen(0,0,300,300,
|
||||
for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) {
|
||||
screen = graw_create_window_and_screen(0, 0, 300, 300,
|
||||
formats[i],
|
||||
&window);
|
||||
if (window && screen)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!screen || !window) {
|
||||
fprintf(stderr, "Unable to create window\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ctx = screen->context_create(screen, NULL);
|
||||
if (ctx == NULL)
|
||||
exit(3);
|
||||
|
||||
@@ -176,15 +176,18 @@ static void init( void )
|
||||
* Also, no easy way of querying supported formats if the screen
|
||||
* cannot be created first.
|
||||
*/
|
||||
for (i = 0;
|
||||
window == NULL && formats[i] != PIPE_FORMAT_NONE;
|
||||
i++) {
|
||||
|
||||
screen = graw_create_window_and_screen(0,0,300,300,
|
||||
for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) {
|
||||
screen = graw_create_window_and_screen(0, 0, 300, 300,
|
||||
formats[i],
|
||||
&window);
|
||||
if (window && screen)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!screen || !window) {
|
||||
fprintf(stderr, "Unable to create window\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ctx = screen->context_create(screen, NULL);
|
||||
if (ctx == NULL)
|
||||
exit(3);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* any utility code, just the graw interface and gallium.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include "state_tracker/graw.h"
|
||||
#include "pipe/p_screen.h"
|
||||
#include "pipe/p_context.h"
|
||||
@@ -182,13 +183,16 @@ static void init( void )
|
||||
* Also, no easy way of querying supported formats if the screen
|
||||
* cannot be created first.
|
||||
*/
|
||||
for (i = 0;
|
||||
window == NULL && formats[i] != PIPE_FORMAT_NONE;
|
||||
i++) {
|
||||
|
||||
screen = graw_create_window_and_screen(0,0,300,300,
|
||||
for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) {
|
||||
screen = graw_create_window_and_screen(0, 0, 300, 300,
|
||||
formats[i],
|
||||
&window);
|
||||
if (window && screen)
|
||||
break;
|
||||
}
|
||||
if (!screen || !window) {
|
||||
fprintf(stderr, "Unable to create window\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ctx = screen->context_create(screen, NULL);
|
||||
|
||||
@@ -234,13 +234,16 @@ static void init( void )
|
||||
* Also, no easy way of querying supported formats if the screen
|
||||
* cannot be created first.
|
||||
*/
|
||||
for (i = 0;
|
||||
window == NULL && formats[i] != PIPE_FORMAT_NONE;
|
||||
i++) {
|
||||
|
||||
screen = graw_create_window_and_screen(0,0,300,300,
|
||||
for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) {
|
||||
screen = graw_create_window_and_screen(0, 0, 300, 300,
|
||||
formats[i],
|
||||
&window);
|
||||
if (window && screen)
|
||||
break;
|
||||
}
|
||||
if (!screen || !window) {
|
||||
fprintf(stderr, "Unable to create window\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ctx = screen->context_create(screen, NULL);
|
||||
|
||||
@@ -162,13 +162,16 @@ static void init( void )
|
||||
* Also, no easy way of querying supported formats if the screen
|
||||
* cannot be created first.
|
||||
*/
|
||||
for (i = 0;
|
||||
window == NULL && formats[i] != PIPE_FORMAT_NONE;
|
||||
i++) {
|
||||
|
||||
screen = graw_create_window_and_screen(0,0,300,300,
|
||||
for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) {
|
||||
screen = graw_create_window_and_screen(0, 0, 300, 300,
|
||||
formats[i],
|
||||
&window);
|
||||
if (window && screen)
|
||||
break;
|
||||
}
|
||||
if (!screen || !window) {
|
||||
fprintf(stderr, "Unable to create window\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ctx = screen->context_create(screen, NULL);
|
||||
|
||||
@@ -384,13 +384,16 @@ static void init( void )
|
||||
* Also, no easy way of querying supported formats if the screen
|
||||
* cannot be created first.
|
||||
*/
|
||||
for (i = 0;
|
||||
window == NULL && formats[i] != PIPE_FORMAT_NONE;
|
||||
i++) {
|
||||
|
||||
screen = graw_create_window_and_screen(0,0,WIDTH,HEIGHT,
|
||||
for (i = 0; formats[i] != PIPE_FORMAT_NONE; i++) {
|
||||
screen = graw_create_window_and_screen(0, 0, 300, 300,
|
||||
formats[i],
|
||||
&window);
|
||||
if (window && screen)
|
||||
break;
|
||||
}
|
||||
if (!screen || !window) {
|
||||
fprintf(stderr, "Unable to create window\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
ctx = screen->context_create(screen, NULL);
|
||||
|
||||
@@ -46,7 +46,7 @@ static int bof_entry_grow(bof_t *bof)
|
||||
}
|
||||
|
||||
/*
|
||||
* object
|
||||
* object
|
||||
*/
|
||||
bof_t *bof_object(void)
|
||||
{
|
||||
|
||||
@@ -206,13 +206,13 @@ int radeon_bo_get_tiling_flags(struct radeon *radeon,
|
||||
{
|
||||
struct drm_radeon_gem_get_tiling args;
|
||||
int ret;
|
||||
|
||||
|
||||
args.handle = bo->handle;
|
||||
ret = drmCommandWriteRead(radeon->fd, DRM_RADEON_GEM_GET_TILING,
|
||||
&args, sizeof(args));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
*tiling_flags = args.tiling_flags;
|
||||
*pitch = args.pitch;
|
||||
return ret;
|
||||
|
||||
@@ -40,29 +40,29 @@ struct pci_id radeon_pci_id[] = {
|
||||
{0x1002, 0x3E54, CHIP_RV380},
|
||||
{0x1002, 0x4136, CHIP_RS100},
|
||||
{0x1002, 0x4137, CHIP_RS200},
|
||||
{0x1002, 0x4144, CHIP_R300},
|
||||
{0x1002, 0x4145, CHIP_R300},
|
||||
{0x1002, 0x4146, CHIP_R300},
|
||||
{0x1002, 0x4147, CHIP_R300},
|
||||
{0x1002, 0x4148, CHIP_R350},
|
||||
{0x1002, 0x4149, CHIP_R350},
|
||||
{0x1002, 0x414A, CHIP_R350},
|
||||
{0x1002, 0x414B, CHIP_R350},
|
||||
{0x1002, 0x4150, CHIP_RV350},
|
||||
{0x1002, 0x4151, CHIP_RV350},
|
||||
{0x1002, 0x4152, CHIP_RV350},
|
||||
{0x1002, 0x4153, CHIP_RV350},
|
||||
{0x1002, 0x4154, CHIP_RV350},
|
||||
{0x1002, 0x4155, CHIP_RV350},
|
||||
{0x1002, 0x4156, CHIP_RV350},
|
||||
{0x1002, 0x4144, CHIP_R300},
|
||||
{0x1002, 0x4145, CHIP_R300},
|
||||
{0x1002, 0x4146, CHIP_R300},
|
||||
{0x1002, 0x4147, CHIP_R300},
|
||||
{0x1002, 0x4148, CHIP_R350},
|
||||
{0x1002, 0x4149, CHIP_R350},
|
||||
{0x1002, 0x414A, CHIP_R350},
|
||||
{0x1002, 0x414B, CHIP_R350},
|
||||
{0x1002, 0x4150, CHIP_RV350},
|
||||
{0x1002, 0x4151, CHIP_RV350},
|
||||
{0x1002, 0x4152, CHIP_RV350},
|
||||
{0x1002, 0x4153, CHIP_RV350},
|
||||
{0x1002, 0x4154, CHIP_RV350},
|
||||
{0x1002, 0x4155, CHIP_RV350},
|
||||
{0x1002, 0x4156, CHIP_RV350},
|
||||
{0x1002, 0x4237, CHIP_RS200},
|
||||
{0x1002, 0x4242, CHIP_R200},
|
||||
{0x1002, 0x4243, CHIP_R200},
|
||||
{0x1002, 0x4242, CHIP_R200},
|
||||
{0x1002, 0x4243, CHIP_R200},
|
||||
{0x1002, 0x4336, CHIP_RS100},
|
||||
{0x1002, 0x4337, CHIP_RS200},
|
||||
{0x1002, 0x4437, CHIP_RS200},
|
||||
{0x1002, 0x4966, CHIP_RV250},
|
||||
{0x1002, 0x4967, CHIP_RV250},
|
||||
{0x1002, 0x4966, CHIP_RV250},
|
||||
{0x1002, 0x4967, CHIP_RV250},
|
||||
{0x1002, 0x4A48, CHIP_R420},
|
||||
{0x1002, 0x4A49, CHIP_R420},
|
||||
{0x1002, 0x4A4A, CHIP_R420},
|
||||
@@ -85,14 +85,14 @@ struct pci_id radeon_pci_id[] = {
|
||||
{0x1002, 0x4C64, CHIP_RV250},
|
||||
{0x1002, 0x4C66, CHIP_RV250},
|
||||
{0x1002, 0x4C67, CHIP_RV250},
|
||||
{0x1002, 0x4E44, CHIP_R300},
|
||||
{0x1002, 0x4E45, CHIP_R300},
|
||||
{0x1002, 0x4E46, CHIP_R300},
|
||||
{0x1002, 0x4E47, CHIP_R300},
|
||||
{0x1002, 0x4E48, CHIP_R350},
|
||||
{0x1002, 0x4E49, CHIP_R350},
|
||||
{0x1002, 0x4E4A, CHIP_R350},
|
||||
{0x1002, 0x4E4B, CHIP_R350},
|
||||
{0x1002, 0x4E44, CHIP_R300},
|
||||
{0x1002, 0x4E45, CHIP_R300},
|
||||
{0x1002, 0x4E46, CHIP_R300},
|
||||
{0x1002, 0x4E47, CHIP_R300},
|
||||
{0x1002, 0x4E48, CHIP_R350},
|
||||
{0x1002, 0x4E49, CHIP_R350},
|
||||
{0x1002, 0x4E4A, CHIP_R350},
|
||||
{0x1002, 0x4E4B, CHIP_R350},
|
||||
{0x1002, 0x4E50, CHIP_RV350},
|
||||
{0x1002, 0x4E51, CHIP_RV350},
|
||||
{0x1002, 0x4E52, CHIP_RV350},
|
||||
@@ -103,13 +103,13 @@ struct pci_id radeon_pci_id[] = {
|
||||
{0x1002, 0x5145, CHIP_R100},
|
||||
{0x1002, 0x5146, CHIP_R100},
|
||||
{0x1002, 0x5147, CHIP_R100},
|
||||
{0x1002, 0x5148, CHIP_R200},
|
||||
{0x1002, 0x514C, CHIP_R200},
|
||||
{0x1002, 0x514D, CHIP_R200},
|
||||
{0x1002, 0x5157, CHIP_RV200},
|
||||
{0x1002, 0x5158, CHIP_RV200},
|
||||
{0x1002, 0x5159, CHIP_RV100},
|
||||
{0x1002, 0x515A, CHIP_RV100},
|
||||
{0x1002, 0x5148, CHIP_R200},
|
||||
{0x1002, 0x514C, CHIP_R200},
|
||||
{0x1002, 0x514D, CHIP_R200},
|
||||
{0x1002, 0x5157, CHIP_RV200},
|
||||
{0x1002, 0x5158, CHIP_RV200},
|
||||
{0x1002, 0x5159, CHIP_RV100},
|
||||
{0x1002, 0x515A, CHIP_RV100},
|
||||
{0x1002, 0x515E, CHIP_RV100},
|
||||
{0x1002, 0x5460, CHIP_RV380},
|
||||
{0x1002, 0x5462, CHIP_RV380},
|
||||
@@ -138,10 +138,10 @@ struct pci_id radeon_pci_id[] = {
|
||||
{0x1002, 0x5955, CHIP_RS480},
|
||||
{0x1002, 0x5974, CHIP_RS480},
|
||||
{0x1002, 0x5975, CHIP_RS480},
|
||||
{0x1002, 0x5960, CHIP_RV280},
|
||||
{0x1002, 0x5961, CHIP_RV280},
|
||||
{0x1002, 0x5962, CHIP_RV280},
|
||||
{0x1002, 0x5964, CHIP_RV280},
|
||||
{0x1002, 0x5960, CHIP_RV280},
|
||||
{0x1002, 0x5961, CHIP_RV280},
|
||||
{0x1002, 0x5962, CHIP_RV280},
|
||||
{0x1002, 0x5964, CHIP_RV280},
|
||||
{0x1002, 0x5965, CHIP_RV280},
|
||||
{0x1002, 0x5969, CHIP_RV100},
|
||||
{0x1002, 0x5a41, CHIP_RS400},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
glsl_compiler
|
||||
glsl_parser.output
|
||||
builtin_function.cpp
|
||||
builtin_compiler
|
||||
|
||||
+25
-3
@@ -318,7 +318,8 @@ public:
|
||||
|
||||
|
||||
enum {
|
||||
ast_precision_high = 0, /**< Default precision. */
|
||||
ast_precision_none = 0, /**< Absence of precision qualifier. */
|
||||
ast_precision_high,
|
||||
ast_precision_medium,
|
||||
ast_precision_low
|
||||
};
|
||||
@@ -364,6 +365,23 @@ struct ast_type_qualifier {
|
||||
* This field is only valid if \c explicit_location is set.
|
||||
*/
|
||||
unsigned location;
|
||||
|
||||
/**
|
||||
* Return true if and only if an interpolation qualifier is present.
|
||||
*/
|
||||
bool has_interpolation() const;
|
||||
|
||||
/**
|
||||
* \brief Return string representation of interpolation qualifier.
|
||||
*
|
||||
* If an interpolation qualifier is present, then return that qualifier's
|
||||
* string representation. Otherwise, return null. For example, if the
|
||||
* noperspective bit is set, then this returns "noperspective".
|
||||
*
|
||||
* If multiple interpolation qualifiers are somehow present, then the
|
||||
* returned string is undefined but not null.
|
||||
*/
|
||||
const char *interpolation_string() const;
|
||||
};
|
||||
|
||||
class ast_struct_specifier : public ast_node {
|
||||
@@ -444,7 +462,8 @@ public:
|
||||
/** Construct a type specifier from a type name */
|
||||
ast_type_specifier(const char *name)
|
||||
: type_specifier(ast_type_name), type_name(name), structure(NULL),
|
||||
is_array(false), array_size(NULL), precision(ast_precision_high)
|
||||
is_array(false), array_size(NULL), precision(ast_precision_none),
|
||||
is_precision_statement(false)
|
||||
{
|
||||
/* empty */
|
||||
}
|
||||
@@ -452,7 +471,8 @@ public:
|
||||
/** Construct a type specifier from a structure definition */
|
||||
ast_type_specifier(ast_struct_specifier *s)
|
||||
: type_specifier(ast_struct), type_name(s->name), structure(s),
|
||||
is_array(false), array_size(NULL), precision(ast_precision_high)
|
||||
is_array(false), array_size(NULL), precision(ast_precision_none),
|
||||
is_precision_statement(false)
|
||||
{
|
||||
/* empty */
|
||||
}
|
||||
@@ -474,6 +494,8 @@ public:
|
||||
ast_expression *array_size;
|
||||
|
||||
unsigned precision:2;
|
||||
|
||||
bool is_precision_statement;
|
||||
};
|
||||
|
||||
|
||||
|
||||
+160
-1
@@ -2277,6 +2277,112 @@ ast_declarator_list::hir(exec_list *instructions,
|
||||
}
|
||||
|
||||
|
||||
/* Interpolation qualifiers cannot be applied to 'centroid' and
|
||||
* 'centroid varying'.
|
||||
*
|
||||
* From page 29 (page 35 of the PDF) of the GLSL 1.30 spec:
|
||||
* "interpolation qualifiers may only precede the qualifiers in,
|
||||
* centroid in, out, or centroid out in a declaration. They do not apply
|
||||
* to the deprecated storage qualifiers varying or centroid varying."
|
||||
*/
|
||||
if (state->language_version >= 130
|
||||
&& this->type->qualifier.has_interpolation()
|
||||
&& this->type->qualifier.flags.q.varying) {
|
||||
|
||||
const char *i = this->type->qualifier.interpolation_string();
|
||||
assert(i != NULL);
|
||||
const char *s;
|
||||
if (this->type->qualifier.flags.q.centroid)
|
||||
s = "centroid varying";
|
||||
else
|
||||
s = "varying";
|
||||
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"qualifier '%s' cannot be applied to the "
|
||||
"deprecated storage qualifier '%s'", i, s);
|
||||
}
|
||||
|
||||
|
||||
/* Interpolation qualifiers can only apply to vertex shader outputs and
|
||||
* fragment shader inputs.
|
||||
*
|
||||
* From page 29 (page 35 of the PDF) of the GLSL 1.30 spec:
|
||||
* "Outputs from a vertex shader (out) and inputs to a fragment
|
||||
* shader (in) can be further qualified with one or more of these
|
||||
* interpolation qualifiers"
|
||||
*/
|
||||
if (state->language_version >= 130
|
||||
&& this->type->qualifier.has_interpolation()) {
|
||||
|
||||
const char *i = this->type->qualifier.interpolation_string();
|
||||
assert(i != NULL);
|
||||
|
||||
switch (state->target) {
|
||||
case vertex_shader:
|
||||
if (this->type->qualifier.flags.q.in) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"qualifier '%s' cannot be applied to vertex "
|
||||
"shader inputs", i);
|
||||
}
|
||||
break;
|
||||
case fragment_shader:
|
||||
if (this->type->qualifier.flags.q.out) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"qualifier '%s' cannot be applied to fragment "
|
||||
"shader outputs", i);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* From section 4.3.4 of the GLSL 1.30 spec:
|
||||
* "It is an error to use centroid in in a vertex shader."
|
||||
*/
|
||||
if (state->language_version >= 130
|
||||
&& this->type->qualifier.flags.q.centroid
|
||||
&& this->type->qualifier.flags.q.in
|
||||
&& state->target == vertex_shader) {
|
||||
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"'centroid in' cannot be used in a vertex shader");
|
||||
}
|
||||
|
||||
|
||||
/* Precision qualifiers exists only in GLSL versions 1.00 and >= 1.30.
|
||||
*/
|
||||
if (this->type->specifier->precision != ast_precision_none
|
||||
&& state->language_version != 100
|
||||
&& state->language_version < 130) {
|
||||
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"precision qualifiers are supported only in GLSL ES "
|
||||
"1.00, and GLSL 1.30 and later");
|
||||
}
|
||||
|
||||
|
||||
/* Precision qualifiers only apply to floating point and integer types.
|
||||
*
|
||||
* From section 4.5.2 of the GLSL 1.30 spec:
|
||||
* "Any floating point or any integer declaration can have the type
|
||||
* preceded by one of these precision qualifiers [...] Literal
|
||||
* constants do not have precision qualifiers. Neither do Boolean
|
||||
* variables.
|
||||
*/
|
||||
if (this->type->specifier->precision != ast_precision_none
|
||||
&& !var->type->is_float()
|
||||
&& !var->type->is_integer()
|
||||
&& !(var->type->is_array()
|
||||
&& (var->type->fields.array->is_float()
|
||||
|| var->type->fields.array->is_integer()))) {
|
||||
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"precision qualifiers apply only to floating point "
|
||||
"and integer types");
|
||||
}
|
||||
|
||||
/* Process the initializer and add its instructions to a temporary
|
||||
* list. This list will be added to the instruction stream (below) after
|
||||
* the declaration is added. This is done because in some cases (such as
|
||||
@@ -2403,7 +2509,8 @@ ast_declarator_list::hir(exec_list *instructions,
|
||||
*/
|
||||
if (this->type->qualifier.flags.q.constant && decl->initializer == NULL) {
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"const declaration of `%s' must be initialized");
|
||||
"const declaration of `%s' must be initialized",
|
||||
decl->identifier);
|
||||
}
|
||||
|
||||
/* Check if this declaration is actually a re-declaration, either to
|
||||
@@ -3132,6 +3239,58 @@ ir_rvalue *
|
||||
ast_type_specifier::hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
if (!this->is_precision_statement && this->structure == NULL)
|
||||
return NULL;
|
||||
|
||||
YYLTYPE loc = this->get_location();
|
||||
|
||||
if (this->precision != ast_precision_none
|
||||
&& state->language_version != 100
|
||||
&& state->language_version < 130) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"precision qualifiers exist only in "
|
||||
"GLSL ES 1.00, and GLSL 1.30 and later");
|
||||
return NULL;
|
||||
}
|
||||
if (this->precision != ast_precision_none
|
||||
&& this->structure != NULL) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"precision qualifiers do not apply to structures");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* If this is a precision statement, check that the type to which it is
|
||||
* applied is either float or int.
|
||||
*
|
||||
* From section 4.5.3 of the GLSL 1.30 spec:
|
||||
* "The precision statement
|
||||
* precision precision-qualifier type;
|
||||
* can be used to establish a default precision qualifier. The type
|
||||
* field can be either int or float [...]. Any other types or
|
||||
* qualifiers will result in an error.
|
||||
*/
|
||||
if (this->is_precision_statement) {
|
||||
assert(this->precision != ast_precision_none);
|
||||
assert(this->structure == NULL); /* The check for structures was
|
||||
* performed above. */
|
||||
if (this->is_array) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"default precision statements do not apply to "
|
||||
"arrays");
|
||||
return NULL;
|
||||
}
|
||||
if (this->type_specifier != ast_float
|
||||
&& this->type_specifier != ast_int) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"default precision statements apply only to types "
|
||||
"float and int");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* FINISHME: Translate precision statements into IR. */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (this->structure != NULL)
|
||||
return this->structure->hir(instructions, state);
|
||||
|
||||
|
||||
+22
-1
@@ -49,7 +49,8 @@ ast_type_specifier::print(void) const
|
||||
|
||||
ast_type_specifier::ast_type_specifier(int specifier)
|
||||
: type_specifier(ast_types(specifier)), type_name(NULL), structure(NULL),
|
||||
is_array(false), array_size(NULL), precision(ast_precision_high)
|
||||
is_array(false), array_size(NULL), precision(ast_precision_none),
|
||||
is_precision_statement(false)
|
||||
{
|
||||
static const char *const names[] = {
|
||||
"void",
|
||||
@@ -116,3 +117,23 @@ ast_fully_specified_type::has_qualifiers() const
|
||||
{
|
||||
return this->qualifier.flags.i != 0;
|
||||
}
|
||||
|
||||
bool ast_type_qualifier::has_interpolation() const
|
||||
{
|
||||
return this->flags.q.smooth
|
||||
|| this->flags.q.flat
|
||||
|| this->flags.q.noperspective;
|
||||
}
|
||||
|
||||
const char*
|
||||
ast_type_qualifier::interpolation_string() const
|
||||
{
|
||||
if (this->flags.q.smooth)
|
||||
return "smooth";
|
||||
else if (this->flags.q.flat)
|
||||
return "flat";
|
||||
else if (this->flags.q.noperspective)
|
||||
return "noperspective";
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+436
-424
File diff suppressed because it is too large
Load Diff
@@ -1,10 +1,9 @@
|
||||
|
||||
/* A Bison parser, made by GNU Bison 2.4.1. */
|
||||
/* A Bison parser, made by GNU Bison 2.4.3. */
|
||||
|
||||
/* Skeleton interface for Bison's Yacc-like parsers in C
|
||||
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
|
||||
Free Software Foundation, Inc.
|
||||
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
|
||||
2009, 2010 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -239,7 +238,7 @@
|
||||
typedef union YYSTYPE
|
||||
{
|
||||
|
||||
/* Line 1676 of yacc.c */
|
||||
/* Line 1685 of yacc.c */
|
||||
#line 52 "glsl_parser.ypp"
|
||||
|
||||
int n;
|
||||
@@ -272,8 +271,8 @@ typedef union YYSTYPE
|
||||
|
||||
|
||||
|
||||
/* Line 1676 of yacc.c */
|
||||
#line 277 "glsl_parser.h"
|
||||
/* Line 1685 of yacc.c */
|
||||
#line 276 "glsl_parser.h"
|
||||
} YYSTYPE;
|
||||
# define YYSTYPE_IS_TRIVIAL 1
|
||||
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
|
||||
|
||||
+10
-12
@@ -276,16 +276,16 @@ extension_statement:
|
||||
external_declaration_list:
|
||||
external_declaration
|
||||
{
|
||||
/* FINISHME: The NULL test is only required because 'precision'
|
||||
* FINISHME: statements are not yet supported.
|
||||
/* FINISHME: The NULL test is required because pragmas are set to
|
||||
* FINISHME: NULL. (See production rule for external_declaration.)
|
||||
*/
|
||||
if ($1 != NULL)
|
||||
state->translation_unit.push_tail(& $1->link);
|
||||
}
|
||||
| external_declaration_list external_declaration
|
||||
{
|
||||
/* FINISHME: The NULL test is only required because 'precision'
|
||||
* FINISHME: statements are not yet supported.
|
||||
/* FINISHME: The NULL test is required because pragmas are set to
|
||||
* FINISHME: NULL. (See production rule for external_declaration.)
|
||||
*/
|
||||
if ($2 != NULL)
|
||||
state->translation_unit.push_tail(& $2->link);
|
||||
@@ -702,14 +702,9 @@ declaration:
|
||||
}
|
||||
| PRECISION precision_qualifier type_specifier_no_prec ';'
|
||||
{
|
||||
if (($3->type_specifier != ast_float)
|
||||
&& ($3->type_specifier != ast_int)) {
|
||||
_mesa_glsl_error(& @3, state, "global precision qualifier can "
|
||||
"only be applied to `int' or `float'\n");
|
||||
YYERROR;
|
||||
}
|
||||
|
||||
$$ = NULL; /* FINISHME */
|
||||
$3->precision = $2;
|
||||
$3->is_precision_statement = true;
|
||||
$$ = $3;
|
||||
}
|
||||
;
|
||||
|
||||
@@ -1195,6 +1190,9 @@ storage_qualifier:
|
||||
|
||||
type_specifier:
|
||||
type_specifier_no_prec
|
||||
{
|
||||
$$ = $1;
|
||||
}
|
||||
| precision_qualifier type_specifier_no_prec
|
||||
{
|
||||
$$ = $2;
|
||||
|
||||
@@ -748,8 +748,10 @@ do_common_optimization(exec_list *ir, bool linked, unsigned max_unroll_iteration
|
||||
progress = optimize_redundant_jumps(ir) || progress;
|
||||
|
||||
loop_state *ls = analyze_loop_variables(ir);
|
||||
progress = set_loop_controls(ir, ls) || progress;
|
||||
progress = unroll_loops(ir, ls, max_unroll_iterations) || progress;
|
||||
if (ls->loop_found) {
|
||||
progress = set_loop_controls(ir, ls) || progress;
|
||||
progress = unroll_loops(ir, ls, max_unroll_iterations) || progress;
|
||||
}
|
||||
delete ls;
|
||||
|
||||
return progress;
|
||||
|
||||
@@ -35,13 +35,10 @@ public:
|
||||
return entry;
|
||||
}
|
||||
|
||||
/* If the user *does* call delete, that's OK, we will just
|
||||
* talloc_free in that case. Here, C++ will have already called the
|
||||
* destructor so tell talloc not to do that again. */
|
||||
static void operator delete(void *table)
|
||||
/* If the user *does* call delete, that's OK, we will just talloc_free. */
|
||||
static void operator delete(void *entry)
|
||||
{
|
||||
talloc_set_destructor(table, NULL);
|
||||
talloc_free(table);
|
||||
talloc_free(entry);
|
||||
}
|
||||
|
||||
symbol_table_entry(ir_variable *v) : v(v), f(0), t(0) {}
|
||||
|
||||
@@ -38,6 +38,7 @@ loop_state::loop_state()
|
||||
this->ht = hash_table_ctor(0, hash_table_pointer_hash,
|
||||
hash_table_pointer_compare);
|
||||
this->mem_ctx = talloc_init("loop state");
|
||||
this->loop_found = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +53,9 @@ loop_variable_state *
|
||||
loop_state::insert(ir_loop *ir)
|
||||
{
|
||||
loop_variable_state *ls = new(this->mem_ctx) loop_variable_state;
|
||||
|
||||
hash_table_insert(this->ht, ls, ir);
|
||||
this->loop_found = true;
|
||||
|
||||
return ls;
|
||||
}
|
||||
|
||||
@@ -214,6 +214,8 @@ public:
|
||||
|
||||
loop_variable_state *insert(ir_loop *ir);
|
||||
|
||||
bool loop_found;
|
||||
|
||||
private:
|
||||
loop_state();
|
||||
|
||||
|
||||
@@ -46,6 +46,12 @@ SOURCES = \
|
||||
applegl_glx.c
|
||||
|
||||
|
||||
ifeq ($(SHARED_GLAPI),1)
|
||||
GL_LIB_DEPS := -L$(TOP)/$(LIB_DIR) -l$(GLAPI_LIB) $(GL_LIB_DEPS)
|
||||
EXTRA_DEFINES += -DGLX_SHARED_GLAPI
|
||||
endif
|
||||
|
||||
# override GLAPI_LIB
|
||||
GLAPI_LIB = $(TOP)/src/mapi/glapi/libglapi.a
|
||||
|
||||
OBJECTS = $(SOURCES:.c=.o)
|
||||
|
||||
+6
-1
@@ -36,6 +36,7 @@
|
||||
#include "glxclient.h"
|
||||
#include "glapi.h"
|
||||
#include "glxextensions.h"
|
||||
#include "indirect.h"
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
#ifdef GLX_USE_APPLEGL
|
||||
@@ -2514,7 +2515,11 @@ _X_EXPORT void (*glXGetProcAddressARB(const GLubyte * procName)) (void)
|
||||
f = (gl_function) get_glx_proc_address((const char *) procName);
|
||||
if ((f == NULL) && (procName[0] == 'g') && (procName[1] == 'l')
|
||||
&& (procName[2] != 'X')) {
|
||||
f = (gl_function) _glapi_get_proc_address((const char *) procName);
|
||||
#ifdef GLX_SHARED_GLAPI
|
||||
f = (gl_function) __indirect_get_proc_address((const char *) procName);
|
||||
#endif
|
||||
if (!f)
|
||||
f = (gl_function) _glapi_get_proc_address((const char *) procName);
|
||||
}
|
||||
#endif
|
||||
return f;
|
||||
|
||||
+62
-2
@@ -10657,5 +10657,65 @@ __indirect_glFramebufferTextureLayerEXT(GLenum target, GLenum attachment,
|
||||
}
|
||||
|
||||
|
||||
# undef FASTCALL
|
||||
# undef NOINLINE
|
||||
#ifdef GLX_SHARED_GLAPI
|
||||
|
||||
static const struct proc_pair {
|
||||
const char *name;
|
||||
_glapi_proc proc;
|
||||
} proc_pairs[20] = {
|
||||
{
|
||||
"AreTexturesResidentEXT", (_glapi_proc) glAreTexturesResidentEXT}, {
|
||||
"DeleteTexturesEXT", (_glapi_proc) glDeleteTexturesEXT}, {
|
||||
"GenTexturesEXT", (_glapi_proc) glGenTexturesEXT}, {
|
||||
"GetColorTableEXT", (_glapi_proc) glGetColorTableEXT}, {
|
||||
"GetColorTableParameterfvEXT",
|
||||
(_glapi_proc) glGetColorTableParameterfvEXT}, {
|
||||
"GetColorTableParameterfvSGI",
|
||||
(_glapi_proc) glGetColorTableParameterfvEXT}, {
|
||||
"GetColorTableParameterivEXT",
|
||||
(_glapi_proc) glGetColorTableParameterivEXT}, {
|
||||
"GetColorTableParameterivSGI",
|
||||
(_glapi_proc) glGetColorTableParameterivEXT}, {
|
||||
"GetColorTableSGI", (_glapi_proc) glGetColorTableEXT}, {
|
||||
"GetConvolutionFilterEXT", (_glapi_proc) gl_dispatch_stub_356}, {
|
||||
"GetConvolutionParameterfvEXT", (_glapi_proc) gl_dispatch_stub_357}, {
|
||||
"GetConvolutionParameterivEXT", (_glapi_proc) gl_dispatch_stub_358}, {
|
||||
"GetHistogramEXT", (_glapi_proc) gl_dispatch_stub_361}, {
|
||||
"GetHistogramParameterfvEXT", (_glapi_proc) gl_dispatch_stub_362}, {
|
||||
"GetHistogramParameterivEXT", (_glapi_proc) gl_dispatch_stub_363}, {
|
||||
"GetMinmaxEXT", (_glapi_proc) gl_dispatch_stub_364}, {
|
||||
"GetMinmaxParameterfvEXT", (_glapi_proc) gl_dispatch_stub_365}, {
|
||||
"GetMinmaxParameterivEXT", (_glapi_proc) gl_dispatch_stub_366}, {
|
||||
"GetSeparableFilterEXT", (_glapi_proc) gl_dispatch_stub_359}, {
|
||||
"IsTextureEXT", (_glapi_proc) glIsTextureEXT}
|
||||
};
|
||||
|
||||
static int
|
||||
__indirect_get_proc_compare(const void *key, const void *memb)
|
||||
{
|
||||
const struct proc_pair *pair = (const struct proc_pair *) memb;
|
||||
return strcmp((const char *) key, pair->name);
|
||||
}
|
||||
|
||||
_glapi_proc
|
||||
__indirect_get_proc_address(const char *name)
|
||||
{
|
||||
const struct proc_pair *pair;
|
||||
|
||||
/* skip "gl" */
|
||||
name += 2;
|
||||
|
||||
pair = (const struct proc_pair *) bsearch((const void *) name,
|
||||
(const void *) proc_pairs,
|
||||
ARRAY_SIZE(proc_pairs),
|
||||
sizeof(proc_pairs[0]),
|
||||
__indirect_get_proc_compare);
|
||||
|
||||
return (pair) ? pair->proc : NULL;
|
||||
}
|
||||
|
||||
#endif /* GLX_SHARED_GLAPI */
|
||||
|
||||
|
||||
#undef FASTCALL
|
||||
#undef NOINLINE
|
||||
|
||||
@@ -715,6 +715,10 @@ extern HIDDEN void __indirect_glRenderbufferStorageEXT(GLenum target, GLenum int
|
||||
extern HIDDEN void __indirect_glBlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
extern HIDDEN void __indirect_glFramebufferTextureLayerEXT(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
|
||||
|
||||
#ifdef GLX_SHARED_GLAPI
|
||||
extern HIDDEN void (*__indirect_get_proc_address(const char *name))(void);
|
||||
#endif
|
||||
|
||||
# undef HIDDEN
|
||||
# undef FASTCALL
|
||||
# undef NOINLINE
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
glapi-stamp
|
||||
glapi
|
||||
main
|
||||
+56
-66
@@ -7,27 +7,27 @@ include $(TOP)/configs/current
|
||||
ifeq ($(ES),)
|
||||
ES := es1
|
||||
|
||||
GLES_HEADER := GLES
|
||||
GLES_PC := glesv1_cm.pc
|
||||
esapi_HEADER := GLES
|
||||
esapi_PC := glesv1_cm.pc
|
||||
|
||||
GLES_LIB := $(GLESv1_CM_LIB)
|
||||
GLES_LIB_NAME := $(GLESv1_CM_LIB_NAME)
|
||||
GLES_LIB_GLOB := $(GLESv1_CM_LIB_GLOB)
|
||||
GLES_LIB_DEPS := $(GLESv1_CM_LIB_DEPS)
|
||||
GLES_LIB_MAJOR := 1
|
||||
GLES_LIB_MINOR := 1
|
||||
GLES_LIB_PATCH := 0
|
||||
esapi_LIB := $(GLESv1_CM_LIB)
|
||||
esapi_LIB_NAME := $(GLESv1_CM_LIB_NAME)
|
||||
esapi_LIB_GLOB := $(GLESv1_CM_LIB_GLOB)
|
||||
esapi_LIB_DEPS := $(GLESv1_CM_LIB_DEPS)
|
||||
esapi_LIB_MAJOR := 1
|
||||
esapi_LIB_MINOR := 1
|
||||
esapi_LIB_PATCH := 0
|
||||
else
|
||||
GLES_HEADER := GLES2
|
||||
GLES_PC := glesv2.pc
|
||||
esapi_HEADER := GLES2
|
||||
esapi_PC := glesv2.pc
|
||||
|
||||
GLES_LIB := $(GLESv2_LIB)
|
||||
GLES_LIB_NAME := $(GLESv2_LIB_NAME)
|
||||
GLES_LIB_GLOB := $(GLESv2_LIB_GLOB)
|
||||
GLES_LIB_DEPS := $(GLESv2_LIB_DEPS)
|
||||
GLES_LIB_MAJOR := 2
|
||||
GLES_LIB_MINOR := 0
|
||||
GLES_LIB_PATCH := 0
|
||||
esapi_LIB := $(GLESv2_LIB)
|
||||
esapi_LIB_NAME := $(GLESv2_LIB_NAME)
|
||||
esapi_LIB_GLOB := $(GLESv2_LIB_GLOB)
|
||||
esapi_LIB_DEPS := $(GLESv2_LIB_DEPS)
|
||||
esapi_LIB_MAJOR := 2
|
||||
esapi_LIB_MINOR := 0
|
||||
esapi_LIB_PATCH := 0
|
||||
endif
|
||||
|
||||
ESAPI = $(ES)api
|
||||
@@ -37,51 +37,40 @@ MAPI := $(TOP)/src/mapi/mapi
|
||||
# directory for generated sources/headers
|
||||
GEN := glapi
|
||||
|
||||
include $(GLAPI)/sources.mak
|
||||
GLAPI_OBJECTS := $(GLAPI_SOURCES:.c=.o)
|
||||
GLAPI_SOURCES := $(addprefix $(GLAPI)/, $(GLAPI_SOURCES))
|
||||
GLAPI_ASM_OBJECTS := $(GLAPI_ASM_SOURCES:.S=.o)
|
||||
GLAPI_ASM_SOURCES := $(addprefix $(GEN)/, $(GLAPI_ASM_SOURCES))
|
||||
esapi_CPPFLAGS := \
|
||||
-I$(TOP)/include \
|
||||
-I$(TOP)/src/mapi \
|
||||
-DMAPI_ABI_HEADER=\"$(ESAPI)/glapi_mapi_tmp.h\"
|
||||
|
||||
include $(MAPI)/sources.mak
|
||||
MAPI_UTIL_OBJECTS := $(MAPI_UTIL_SOURCES:.c=.o)
|
||||
MAPI_UTIL_SOURCES := $(addprefix $(MAPI)/, $(MAPI_UTIL_SOURCES))
|
||||
esapi_SOURCES := $(addprefix $(MAPI)/, $(MAPI_BRIDGE_SOURCES))
|
||||
esapi_OBJECTS := $(MAPI_BRIDGE_SOURCES:.c=.o)
|
||||
esapi_CPPFLAGS += -DMAPI_MODE_BRIDGE
|
||||
|
||||
ESAPI_OBJECTS = $(GLAPI_OBJECTS) $(GLAPI_ASM_OBJECTS) $(MAPI_UTIL_OBJECTS)
|
||||
|
||||
INCLUDE_DIRS = \
|
||||
-I$(TOP)/include \
|
||||
-I$(TOP)/src/mapi/$(ESAPI) \
|
||||
-I$(TOP)/src/mapi \
|
||||
-I$(TOP)/src/mesa
|
||||
esapi_LIB_DEPS := -L$(TOP)/$(LIB_DIR) -l$(GLAPI_LIB) $(esapi_LIB_DEPS)
|
||||
|
||||
.PHONY: default
|
||||
default: depend $(TOP)/$(LIB_DIR)/$(GLES_LIB_NAME)
|
||||
default: depend $(TOP)/$(LIB_DIR)/$(esapi_LIB_NAME)
|
||||
|
||||
$(TOP)/$(LIB_DIR)/$(GLES_LIB_NAME): $(ESAPI_OBJECTS)
|
||||
$(MKLIB) -o $(GLES_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
-major $(GLES_LIB_MAJOR) \
|
||||
-minor $(GLES_LIB_MINOR) \
|
||||
-patch $(GLES_LIB_PATCH) \
|
||||
-id $(INSTALL_LIB_DIR)/lib$(GLES_LIB).$(GLES_LIB_MAJOR).dylib \
|
||||
$(TOP)/$(LIB_DIR)/$(esapi_LIB_NAME): $(esapi_OBJECTS)
|
||||
$(MKLIB) -o $(esapi_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
-major $(esapi_LIB_MAJOR) \
|
||||
-minor $(esapi_LIB_MINOR) \
|
||||
-patch $(esapi_LIB_PATCH) \
|
||||
-id $(INSTALL_LIB_DIR)/lib$(esapi_LIB).$(esapi_LIB_MAJOR).dylib \
|
||||
$(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
|
||||
$(ESAPI_OBJECTS) $(GLES_LIB_DEPS)
|
||||
$(esapi_OBJECTS) $(esapi_LIB_DEPS)
|
||||
|
||||
# not used, but kept for completeness
|
||||
lib$(ESAPI).a: $(ESAPI_OBJECTS)
|
||||
@$(MKLIB) -o $(ESAPI) -static $(ESAPI_OBJECTS)
|
||||
lib$(ESAPI).a: $(esapi_OBJECTS)
|
||||
@$(MKLIB) -o $(ESAPI) -static $(esapi_OBJECTS)
|
||||
|
||||
$(GLAPI_OBJECTS): %.o: $(GLAPI)/%.c
|
||||
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) -DMAPI_MODE_UTIL $< -o $@
|
||||
$(esapi_OBJECTS): %.o: $(MAPI)/%.c
|
||||
$(CC) -c $(esapi_CPPFLAGS) $(CFLAGS) $< -o $@
|
||||
|
||||
$(GLAPI_ASM_OBJECTS): %.o: $(GEN)/%.S
|
||||
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
|
||||
|
||||
$(MAPI_UTIL_OBJECTS): %.o: $(MAPI)/%.c
|
||||
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) -DMAPI_MODE_UTIL $< -o $@
|
||||
|
||||
$(GLAPI_SOURCES) $(GLAPI_ASM_SOURCES): | glapi-stamp
|
||||
$(esapi_SOURCES): | glapi-stamp
|
||||
|
||||
.PHONY: glapi-stamp
|
||||
glapi-stamp:
|
||||
@# generate sources/headers
|
||||
@$(MAKE) -C $(GLAPI)/gen-es $(ES)
|
||||
@@ -89,10 +78,10 @@ glapi-stamp:
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-rm -f $(GLES_PC)
|
||||
-rm -f $(TOP)/$(LIB_DIR)/$(GLES_LIB_NAME)
|
||||
-rm -f $(esapi_PC)
|
||||
-rm -f $(TOP)/$(LIB_DIR)/$(esapi_LIB_NAME)
|
||||
-rm -f lib$(ESAPI).a
|
||||
-rm -f $(ESAPI_OBJECTS)
|
||||
-rm -f $(esapi_OBJECTS)
|
||||
-rm -f depend depend.bak
|
||||
-rm -f glapi-stamp
|
||||
@# clean generated sources/headers
|
||||
@@ -118,27 +107,28 @@ pcedit-es2 = \
|
||||
-e 's,@GLESv2_PC_CFLAGS@,$(GLESv2_PC_CFLAGS),' \
|
||||
-e 's,@GLESv2_LIB@,$(GLESv2_LIB),'
|
||||
|
||||
$(GLES_PC): $(GLES_PC).in
|
||||
$(esapi_PC): $(esapi_PC).in
|
||||
@sed $(pcedit-$(ES)) $< > $@
|
||||
|
||||
install-headers:
|
||||
$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/$(GLES_HEADER)
|
||||
$(INSTALL) -m 644 $(TOP)/include/$(GLES_HEADER)/*.h \
|
||||
$(DESTDIR)$(INSTALL_INC_DIR)/$(GLES_HEADER)
|
||||
$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/$(esapi_HEADER)
|
||||
$(INSTALL) -m 644 $(TOP)/include/$(esapi_HEADER)/*.h \
|
||||
$(DESTDIR)$(INSTALL_INC_DIR)/$(esapi_HEADER)
|
||||
|
||||
install-pc: $(GLES_PC)
|
||||
install-pc: $(esapi_PC)
|
||||
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
|
||||
$(INSTALL) -m 644 $(GLES_PC) $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
|
||||
$(INSTALL) -m 644 $(esapi_PC) $(DESTDIR)$(INSTALL_LIB_DIR)/pkgconfig
|
||||
|
||||
install: default install-headers install-pc
|
||||
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
|
||||
$(MINSTALL) $(TOP)/$(LIB_DIR)/$(GLES_LIB_GLOB) \
|
||||
$(MINSTALL) $(TOP)/$(LIB_DIR)/$(esapi_LIB_GLOB) \
|
||||
$(DESTDIR)$(INSTALL_LIB_DIR)
|
||||
|
||||
depend: $(GLAPI_SOURCES) $(MAPI_UTIL_SOURCES)
|
||||
depend: $(esapi_SOURCES)
|
||||
@echo "running $(MKDEP)"
|
||||
@touch depend
|
||||
@$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(INCLUDE_DIRS) \
|
||||
-DMAPI_MODE_UTIL $(GLAPI_SOURCES) $(MAPI_UTIL_SOURCES) \
|
||||
2>/dev/null | sed -e 's,^$(GLAPI)/,,' -e 's,^$(MAPI)/,,' \
|
||||
> depend
|
||||
@$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(esapi_CPPFLAGS) \
|
||||
$(esapi_SOURCES) 2>/dev/null | \
|
||||
sed -e 's,^$(GLAPI)/,,' -e 's,^$(MAPI)/,,' > depend
|
||||
|
||||
-include depend
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
glapi-stamp
|
||||
glapi
|
||||
main
|
||||
+36
-22
@@ -8,46 +8,60 @@ TARGET = glapi
|
||||
MAPI = $(TOP)/src/mapi/mapi
|
||||
|
||||
include sources.mak
|
||||
GLAPI_OBJECTS = $(GLAPI_SOURCES:.c=.o)
|
||||
GLAPI_ASM_OBJECTS = $(GLAPI_ASM_SOURCES:.S=.o)
|
||||
|
||||
include $(MAPI)/sources.mak
|
||||
MAPI_UTIL_OBJECTS := $(MAPI_UTIL_SOURCES:.c=.o)
|
||||
MAPI_UTIL_SOURCES := $(addprefix $(MAPI)/, $(MAPI_UTIL_SOURCES))
|
||||
|
||||
TARGET_OBJECTS = $(GLAPI_OBJECTS) $(GLAPI_ASM_OBJECTS) $(MAPI_UTIL_OBJECTS)
|
||||
|
||||
INCLUDE_DIRS = \
|
||||
glapi_CPPFLAGS := \
|
||||
-I$(TOP)/include \
|
||||
-I$(TOP)/src/mapi \
|
||||
-I$(TOP)/src/mesa
|
||||
-I$(TOP)/src/mesa \
|
||||
-DMAPI_ABI_HEADER=\"glapi/glapi_mapi_tmp.h\"
|
||||
|
||||
ifeq ($(SHARED_GLAPI),1)
|
||||
glapi_CPPFLAGS += -DMAPI_MODE_BRIDGE
|
||||
glapi_SOURCES := $(addprefix $(MAPI)/, $(MAPI_BRIDGE_SOURCES))
|
||||
|
||||
glapi_GLAPI_OBJECTS :=
|
||||
glapi_ASM_OBJECTS :=
|
||||
glapi_MAPI_OBJECTS := $(MAPI_BRIDGE_SOURCES:.c=.o)
|
||||
else
|
||||
glapi_CPPFLAGS += -DMAPI_MODE_UTIL
|
||||
glapi_SOURCES := $(GLAPI_SOURCES) $(addprefix $(MAPI)/, $(MAPI_UTIL_SOURCES))
|
||||
|
||||
glapi_GLAPI_OBJECTS := $(GLAPI_SOURCES:.c=.o)
|
||||
glapi_ASM_OBJECTS := $(GLAPI_ASM_SOURCES:.S=.o)
|
||||
glapi_MAPI_OBJECTS := $(MAPI_UTIL_SOURCES:.c=.o)
|
||||
endif # SHARED_GLAPI
|
||||
|
||||
glapi_OBJECTS := \
|
||||
$(glapi_GLAPI_OBJECTS) \
|
||||
$(glapi_ASM_OBJECTS) \
|
||||
$(glapi_MAPI_OBJECTS)
|
||||
|
||||
default: depend lib$(TARGET).a
|
||||
|
||||
lib$(TARGET).a: $(TARGET_OBJECTS)
|
||||
@$(MKLIB) -o $(TARGET) -static $(TARGET_OBJECTS)
|
||||
lib$(TARGET).a: $(glapi_OBJECTS)
|
||||
@$(MKLIB) -o $(TARGET) -static $(glapi_OBJECTS)
|
||||
|
||||
$(GLAPI_OBJECTS): %.o: %.c
|
||||
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) -DMAPI_MODE_UTIL $< -o $@
|
||||
$(glapi_GLAPI_OBJECTS): %.o: %.c
|
||||
$(CC) -c $(glapi_CPPFLAGS) $(CFLAGS) $< -o $@
|
||||
|
||||
$(GLAPI_ASM_OBJECTS): %.o: %.S
|
||||
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $< -o $@
|
||||
$(glapi_ASM_OBJECTS): %.o: %.S
|
||||
$(CC) -c $(glapi_CPPFLAGS) $(CFLAGS) $< -o $@
|
||||
|
||||
$(MAPI_UTIL_OBJECTS): %.o: $(MAPI)/%.c
|
||||
$(CC) -c $(INCLUDE_DIRS) $(CFLAGS) -DMAPI_MODE_UTIL $< -o $@
|
||||
$(glapi_MAPI_OBJECTS): %.o: $(MAPI)/%.c
|
||||
$(CC) -c $(glapi_CPPFLAGS) $(CFLAGS) $< -o $@
|
||||
|
||||
install:
|
||||
|
||||
clean:
|
||||
-rm -f $(TARGET_OBJECTS)
|
||||
-rm -f $(glapi_OBJECTS)
|
||||
-rm -f lib$(TARGET).a
|
||||
-rm -f depend depend.bak
|
||||
|
||||
depend: $(GLAPI_SOURCES) $(MAPI_UTIL_SOURCES)
|
||||
depend: $(glapi_SOURCES)
|
||||
@ echo "running $(MKDEP)"
|
||||
@ touch depend
|
||||
@$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(INCLUDE_DIRS) \
|
||||
-DMAPI_MODE_UTIL $(GLAPI_SOURCES) $(MAPI_UTIL_SOURCES) \
|
||||
2>/dev/null | sed -e 's,^$(MAPI)/,,' > depend
|
||||
@$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(glapi_CPPFLAGS) \
|
||||
$(glapi_SOURCES) 2>/dev/null | sed -e 's,^$(MAPI)/,,' > depend
|
||||
|
||||
-include depend
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
TOP = ../../../..
|
||||
MAPI = $(TOP)/src/mapi/mapi
|
||||
GLAPI = ../gen
|
||||
include $(TOP)/configs/current
|
||||
|
||||
OUTPUTS := \
|
||||
glapi/glapitable.h \
|
||||
glapi/glapitemp.h \
|
||||
glapi/glprocs.h \
|
||||
glapi/glapi_sparc.S \
|
||||
glapi/glapi_x86-64.S \
|
||||
glapi/glapi_x86.S \
|
||||
glapi_mapi_tmp.h \
|
||||
main/glapidispatch.h \
|
||||
main/remap_helper.h
|
||||
|
||||
COMMON = gl_XML.py glX_XML.py license.py typeexpr.py
|
||||
COMMON = gl_and_es_API.xml gl_XML.py glX_XML.py license.py typeexpr.py
|
||||
COMMON := $(addprefix $(GLAPI)/, $(COMMON))
|
||||
|
||||
ES1_APIXML := es1_API.xml
|
||||
@@ -28,42 +24,42 @@ ES2_DEPS = $(ES2_APIXML) base2_API.xml es2_EXT.xml es_EXT.xml \
|
||||
ES1_OUTPUTS := $(addprefix $(ES1_OUTPUT_DIR)/, $(OUTPUTS))
|
||||
ES2_OUTPUTS := $(addprefix $(ES2_OUTPUT_DIR)/, $(OUTPUTS))
|
||||
|
||||
all: es1 es2
|
||||
SHARED_GLAPI_APIXML := $(GLAPI)/gl_and_es_API.xml
|
||||
SHARED_GLAPI_OUTPUT_DIR := $(TOP)/src/mapi/shared-glapi
|
||||
SHARED_GLAPI_DEPS := $(SHARED_GLAPI_APIXML)
|
||||
SHARED_GLAPI_OUTPUTS = $(SHARED_GLAPI_OUTPUT_DIR)/glapi_mapi_tmp.h
|
||||
|
||||
all: es1 es2 shared-glapi
|
||||
|
||||
es1: $(ES1_OUTPUTS)
|
||||
es2: $(ES2_OUTPUTS)
|
||||
shared-glapi: $(SHARED_GLAPI_OUTPUTS)
|
||||
|
||||
$(ES1_OUTPUTS): APIXML := $(ES1_APIXML)
|
||||
$(ES2_OUTPUTS): APIXML := $(ES2_APIXML)
|
||||
$(ES1_OUTPUTS): PRINTER := es1api
|
||||
$(ES1_OUTPUTS): $(ES1_DEPS)
|
||||
|
||||
$(ES2_OUTPUTS): APIXML := $(ES2_APIXML)
|
||||
$(ES2_OUTPUTS): PRINTER := es2api
|
||||
$(ES2_OUTPUTS): $(ES2_DEPS)
|
||||
|
||||
$(SHARED_GLAPI_OUTPUTS): APIXML := $(SHARED_GLAPI_APIXML)
|
||||
$(SHARED_GLAPI_OUTPUTS): PRINTER := shared-glapi
|
||||
$(SHARED_GLAPI_OUTPUTS): $(SHARED_GLAPI_DEPS)
|
||||
|
||||
define gen-glapi
|
||||
@mkdir -p $(dir $@)
|
||||
$(PYTHON2) $(PYTHON_FLAGS) $< -f $(APIXML) $(1) > $@
|
||||
endef
|
||||
|
||||
%/glapidispatch.h: $(GLAPI)/gl_table.py $(COMMON)
|
||||
%/glapi_mapi_tmp.h: $(MAPI)/mapi_abi.py $(COMMON)
|
||||
@mkdir -p $(dir $@)
|
||||
$(PYTHON2) $(PYTHON_FLAGS) $< \
|
||||
--printer $(PRINTER) --mode lib $(GLAPI)/gl_and_es_API.xml > $@
|
||||
|
||||
%/main/glapidispatch.h: $(GLAPI)/gl_table.py $(COMMON)
|
||||
$(call gen-glapi,-c -m remap_table)
|
||||
|
||||
%/glapitable.h: $(GLAPI)/gl_table.py $(COMMON)
|
||||
$(call gen-glapi,-c)
|
||||
|
||||
%/glapitemp.h: $(GLAPI)/gl_apitemp.py $(COMMON)
|
||||
$(call gen-glapi,-c)
|
||||
|
||||
%/glprocs.h: $(GLAPI)/gl_procs.py $(COMMON)
|
||||
$(call gen-glapi,-c)
|
||||
|
||||
%/glapi_sparc.S: $(GLAPI)/gl_SPARC_asm.py $(COMMON)
|
||||
$(call gen-glapi)
|
||||
|
||||
%/glapi_x86-64.S: $(GLAPI)/gl_x86-64_asm.py $(COMMON)
|
||||
$(call gen-glapi)
|
||||
|
||||
%/glapi_x86.S: $(GLAPI)/gl_x86_asm.py $(COMMON)
|
||||
$(call gen-glapi)
|
||||
|
||||
%/main/remap_helper.h: $(GLAPI)/remap_helper.py $(COMMON)
|
||||
$(call gen-glapi)
|
||||
|
||||
@@ -81,12 +77,15 @@ verify_xml:
|
||||
@rm -f tmp.xml
|
||||
|
||||
clean-es1:
|
||||
-rm -rf $(ES1_OUTPUT_DIR)/glapi
|
||||
-rm -f $(ES1_OUTPUTS)
|
||||
-rm -rf $(ES1_OUTPUT_DIR)/main
|
||||
|
||||
clean-es2:
|
||||
-rm -rf $(ES2_OUTPUT_DIR)/glapi
|
||||
-rm -f $(ES2_OUTPUTS)
|
||||
-rm -rf $(ES2_OUTPUT_DIR)/main
|
||||
|
||||
clean: clean-es1 clean-es2
|
||||
clean-shared-glapi:
|
||||
-rm -f $(SHARED_GLAPI_OUTPUTS)
|
||||
|
||||
clean: clean-es1 clean-es2 clean-shared-glapi
|
||||
-rm -f *~ *.pyc *.pyo
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
|
||||
|
||||
<!-- This is included by gl_and_es_API.xml. Could be moved to gl_API.xml. -->
|
||||
|
||||
<OpenGLAPI>
|
||||
|
||||
<category name="GL_ARB_get_program_binary " number="96">
|
||||
<enum name="PROGRAM_BINARY_RETRIEVABLE_HINT" value="0x8257"/>
|
||||
<enum name="PROGRAM_BINARY_LENGTH" value="0x8741"/>
|
||||
<enum name="NUM_PROGRAM_BINARY_FORMATS" value="0x87FE"/>
|
||||
<enum name="PROGRAM_BINARY_FORMATS" value="0x87FF"/>
|
||||
|
||||
<function name="GetProgramBinary" offset="assign" static_dispatch="false">
|
||||
<param name="program" type="GLuint"/>
|
||||
<param name="bufSize" type="GLsizei"/>
|
||||
<param name="length" type="GLsizei *"/>
|
||||
<param name="binaryFormat" type="GLenum *"/>
|
||||
<param name="binary" type="GLvoid *"/>
|
||||
</function>
|
||||
|
||||
<function name="ProgramBinary" offset="assign" static_dispatch="false">
|
||||
<param name="program" type="GLuint"/>
|
||||
<param name="binaryFormat" type="GLenum"/>
|
||||
<param name="binary" type="const GLvoid *"/>
|
||||
<param name="length" type="GLsizei"/>
|
||||
</function>
|
||||
|
||||
<function name="ProgramParameteri" offset="assign" static_dispatch="false">
|
||||
<param name="program" type="GLuint"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="value" type="GLint"/>
|
||||
</function>
|
||||
</category>
|
||||
|
||||
</OpenGLAPI>
|
||||
@@ -9,9 +9,11 @@ include $(TOP)/configs/current
|
||||
|
||||
MESA_DIR = $(TOP)/src/mesa
|
||||
MESA_GLAPI_DIR = $(TOP)/src/mapi/glapi
|
||||
MESA_MAPI_DIR = $(TOP)/src/mapi/mapi
|
||||
MESA_GLX_DIR = $(TOP)/src/glx
|
||||
|
||||
MESA_GLAPI_OUTPUTS = \
|
||||
$(MESA_GLAPI_DIR)/glapi_mapi_tmp.h \
|
||||
$(MESA_GLAPI_DIR)/glprocs.h \
|
||||
$(MESA_GLAPI_DIR)/glapitemp.h \
|
||||
$(MESA_GLAPI_DIR)/glapitable.h
|
||||
@@ -102,6 +104,15 @@ API_XML = \
|
||||
|
||||
COMMON = $(API_XML) gl_XML.py glX_XML.py license.py typeexpr.py
|
||||
|
||||
COMMON_ES = \
|
||||
$(COMMON) \
|
||||
gl_and_es_API.xml \
|
||||
es_EXT.xml \
|
||||
ARB_ES2_compatibility.xml \
|
||||
ARB_get_program_binary.xml \
|
||||
OES_fixed_point.xml \
|
||||
OES_single_precision.xml
|
||||
|
||||
COMMON_GLX = $(COMMON) glX_API.xml glX_XML.py glX_proto_common.py
|
||||
|
||||
######################################################################
|
||||
@@ -132,6 +143,10 @@ $(XORG_GLAPI_DIR)/%.h: $(MESA_GLAPI_DIR)/%.h
|
||||
|
||||
######################################################################
|
||||
|
||||
$(MESA_GLAPI_DIR)/glapi_mapi_tmp.h: $(MESA_MAPI_DIR)/mapi_abi.py $(COMMON_ES)
|
||||
$(PYTHON2) $(PYTHON_FLAGS) $< \
|
||||
--printer glapi --mode lib gl_and_es_API.xml > $@
|
||||
|
||||
$(MESA_GLAPI_DIR)/glprocs.h: gl_procs.py $(COMMON)
|
||||
$(PYTHON2) $(PYTHON_FLAGS) $< > $@
|
||||
|
||||
|
||||
@@ -0,0 +1,259 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
|
||||
|
||||
<!-- This is included by gl_and_es_API.xml. Could be moved to gl_API.xml. -->
|
||||
<!-- this extension is incomplete -->
|
||||
|
||||
<OpenGLAPI>
|
||||
|
||||
<category name="GL_OES_fixed_point" number="292">
|
||||
<enum name="FIXED_OES" value="0x140C"/>
|
||||
|
||||
<type name="fixed" size="4" />
|
||||
<type name="clampx" size="4" />
|
||||
|
||||
<!-- OpenGL ES 1.0 -->
|
||||
<function name="AlphaFuncxOES" offset="assign" static_dispatch="false">
|
||||
<param name="func" type="GLenum"/>
|
||||
<param name="ref" type="GLclampx"/>
|
||||
</function>
|
||||
|
||||
<function name="ClearColorxOES" offset="assign" static_dispatch="false">
|
||||
<param name="red" type="GLclampx"/>
|
||||
<param name="green" type="GLclampx"/>
|
||||
<param name="blue" type="GLclampx"/>
|
||||
<param name="alpha" type="GLclampx"/>
|
||||
</function>
|
||||
|
||||
<function name="ClearDepthxOES" offset="assign" static_dispatch="false">
|
||||
<param name="depth" type="GLclampx"/>
|
||||
</function>
|
||||
|
||||
<function name="Color4xOES" offset="assign" static_dispatch="false">
|
||||
<param name="red" type="GLfixed"/>
|
||||
<param name="green" type="GLfixed"/>
|
||||
<param name="blue" type="GLfixed"/>
|
||||
<param name="alpha" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="DepthRangexOES" offset="assign" static_dispatch="false">
|
||||
<param name="zNear" type="GLclampx"/>
|
||||
<param name="zFar" type="GLclampx"/>
|
||||
</function>
|
||||
|
||||
<function name="FogxOES" offset="assign" static_dispatch="false">
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="param" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="FogxvOES" offset="assign" static_dispatch="false">
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="const GLfixed *" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="FrustumxOES" offset="assign" static_dispatch="false">
|
||||
<param name="left" type="GLfixed"/>
|
||||
<param name="right" type="GLfixed"/>
|
||||
<param name="bottom" type="GLfixed"/>
|
||||
<param name="top" type="GLfixed"/>
|
||||
<param name="zNear" type="GLfixed"/>
|
||||
<param name="zFar" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="LightModelxOES" offset="assign" static_dispatch="false">
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="param" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="LightModelxvOES" offset="assign" static_dispatch="false">
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="const GLfixed *" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="LightxOES" offset="assign" static_dispatch="false">
|
||||
<param name="light" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="param" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="LightxvOES" offset="assign" static_dispatch="false">
|
||||
<param name="light" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="const GLfixed *" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="LineWidthxOES" offset="assign" static_dispatch="false">
|
||||
<param name="width" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="LoadMatrixxOES" offset="assign" static_dispatch="false">
|
||||
<param name="m" type="const GLfixed *" count="16"/>
|
||||
</function>
|
||||
|
||||
<function name="MaterialxOES" offset="assign" static_dispatch="false">
|
||||
<param name="face" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="param" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="MaterialxvOES" offset="assign" static_dispatch="false">
|
||||
<param name="face" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="const GLfixed *" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="MultMatrixxOES" offset="assign" static_dispatch="false">
|
||||
<param name="m" type="const GLfixed *" count="16"/>
|
||||
</function>
|
||||
|
||||
<function name="MultiTexCoord4xOES" offset="assign" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="s" type="GLfixed"/>
|
||||
<param name="t" type="GLfixed"/>
|
||||
<param name="r" type="GLfixed"/>
|
||||
<param name="q" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="Normal3xOES" offset="assign" static_dispatch="false">
|
||||
<param name="nx" type="GLfixed"/>
|
||||
<param name="ny" type="GLfixed"/>
|
||||
<param name="nz" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="OrthoxOES" offset="assign" static_dispatch="false">
|
||||
<param name="left" type="GLfixed"/>
|
||||
<param name="right" type="GLfixed"/>
|
||||
<param name="bottom" type="GLfixed"/>
|
||||
<param name="top" type="GLfixed"/>
|
||||
<param name="zNear" type="GLfixed"/>
|
||||
<param name="zFar" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="PointSizexOES" offset="assign" static_dispatch="false">
|
||||
<param name="size" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="PolygonOffsetxOES" offset="assign" static_dispatch="false">
|
||||
<param name="factor" type="GLfixed"/>
|
||||
<param name="units" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="RotatexOES" offset="assign" static_dispatch="false">
|
||||
<param name="angle" type="GLfixed"/>
|
||||
<param name="x" type="GLfixed"/>
|
||||
<param name="y" type="GLfixed"/>
|
||||
<param name="z" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="SampleCoveragexOES" offset="assign" static_dispatch="false">
|
||||
<param name="value" type="GLclampx"/>
|
||||
<param name="invert" type="GLboolean"/>
|
||||
</function>
|
||||
|
||||
<function name="ScalexOES" offset="assign" static_dispatch="false">
|
||||
<param name="x" type="GLfixed"/>
|
||||
<param name="y" type="GLfixed"/>
|
||||
<param name="z" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="TexEnvxOES" offset="assign" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="param" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="TexEnvxvOES" offset="assign" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="const GLfixed *" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="TexParameterxOES" offset="assign" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="param" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="TranslatexOES" offset="assign" static_dispatch="false">
|
||||
<param name="x" type="GLfixed"/>
|
||||
<param name="y" type="GLfixed"/>
|
||||
<param name="z" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<!-- OpenGL ES 1.1 -->
|
||||
<function name="ClipPlanexOES" offset="assign" static_dispatch="false">
|
||||
<param name="plane" type="GLenum"/>
|
||||
<param name="equation" type="const GLfixed *" count="4"/>
|
||||
</function>
|
||||
|
||||
<function name="GetClipPlanexOES" offset="assign" static_dispatch="false">
|
||||
<param name="plane" type="GLenum"/>
|
||||
<param name="equation" type="GLfixed *" output="true" count="4"/>
|
||||
</function>
|
||||
|
||||
<function name="GetFixedvOES" offset="assign" static_dispatch="false">
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="GLfixed *" output="true" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="GetLightxvOES" offset="assign" static_dispatch="false">
|
||||
<param name="light" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="GLfixed *" output="true" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="GetMaterialxvOES" offset="assign" static_dispatch="false">
|
||||
<param name="face" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="GLfixed *" output="true" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="GetTexEnvxvOES" offset="assign" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="GLfixed *" output="true" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="GetTexParameterxvOES" offset="assign" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="GLfixed *" output="true" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="PointParameterxOES" offset="assign" static_dispatch="false">
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="param" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="PointParameterxvOES" offset="assign" static_dispatch="false">
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="const GLfixed *"/>
|
||||
</function>
|
||||
|
||||
<function name="TexParameterxvOES" offset="assign" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="const GLfixed *" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<!-- texgen -->
|
||||
<function name="GetTexGenxvOES" offset="assign" static_dispatch="false">
|
||||
<param name="coord" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="GLfixed *" output="true" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="TexGenxOES" offset="assign" static_dispatch="false">
|
||||
<param name="coord" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="param" type="GLint"/>
|
||||
</function>
|
||||
|
||||
<function name="TexGenxvOES" offset="assign" static_dispatch="false">
|
||||
<param name="coord" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="const GLfixed *" variable_param="pname"/>
|
||||
</function>
|
||||
</category>
|
||||
|
||||
</OpenGLAPI>
|
||||
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
|
||||
|
||||
<!-- This is included by gl_and_es_API.xml. Could be moved to gl_API.xml. -->
|
||||
|
||||
<OpenGLAPI>
|
||||
|
||||
<category name="GL_OES_single_precision" number="293">
|
||||
<function name="ClearDepthfOES" alias="ClearDepthf" static_dispatch="false">
|
||||
<param name="depth" type="GLclampf"/>
|
||||
</function>
|
||||
|
||||
<function name="ClipPlanefOES" offset="assign" static_dispatch="false">
|
||||
<param name="plane" type="GLenum"/>
|
||||
<param name="equation" type="const GLfloat *" count="4"/>
|
||||
</function>
|
||||
|
||||
<function name="DepthRangefOES" alias="DepthRangef" static_dispatch="false">
|
||||
<param name="zNear" type="GLclampf"/>
|
||||
<param name="zFar" type="GLclampf"/>
|
||||
</function>
|
||||
|
||||
<function name="GetClipPlanefOES" offset="assign" static_dispatch="false">
|
||||
<param name="plane" type="GLenum"/>
|
||||
<param name="equation" type="GLfloat *" output="true" count="4"/>
|
||||
</function>
|
||||
|
||||
<function name="FrustumfOES" offset="assign" static_dispatch="false">
|
||||
<param name="left" type="GLfloat"/>
|
||||
<param name="right" type="GLfloat"/>
|
||||
<param name="bottom" type="GLfloat"/>
|
||||
<param name="top" type="GLfloat"/>
|
||||
<param name="zNear" type="GLfloat"/>
|
||||
<param name="zFar" type="GLfloat"/>
|
||||
</function>
|
||||
|
||||
<function name="OrthofOES" offset="assign" static_dispatch="false">
|
||||
<param name="left" type="GLfloat"/>
|
||||
<param name="right" type="GLfloat"/>
|
||||
<param name="bottom" type="GLfloat"/>
|
||||
<param name="top" type="GLfloat"/>
|
||||
<param name="zNear" type="GLfloat"/>
|
||||
<param name="zFar" type="GLfloat"/>
|
||||
</function>
|
||||
</category>
|
||||
|
||||
</OpenGLAPI>
|
||||
@@ -0,0 +1,618 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE OpenGLAPI SYSTEM "../gen/gl_API.dtd">
|
||||
|
||||
<!-- OpenGL ES specific extensions -->
|
||||
|
||||
<OpenGLAPI>
|
||||
|
||||
<!-- part of es1.1 extension pack -->
|
||||
<category name="GL_OES_blend_equation_separate" number="1">
|
||||
<enum name="BLEND_EQUATION_RGB_OES" value="0x8009"/>
|
||||
<enum name="BLEND_EQUATION_ALPHA_OES" value="0x883D"/>
|
||||
|
||||
<function name="BlendEquationSeparateOES" alias="BlendEquationSeparateEXT" static_dispatch="false">
|
||||
<param name="modeRGB" type="GLenum"/>
|
||||
<param name="modeA" type="GLenum"/>
|
||||
</function>
|
||||
</category>
|
||||
|
||||
<!-- part of es1.1 extension pack -->
|
||||
<category name="GL_OES_blend_func_separate" number="2">
|
||||
<enum name="BLEND_DST_RGB_OES" value="0x80C8"/>
|
||||
<enum name="BLEND_SRC_RGB_OES" value="0x80C9"/>
|
||||
<enum name="BLEND_DST_ALPHA_OES" value="0x80CA"/>
|
||||
<enum name="BLEND_SRC_ALPHA_OES" value="0x80CB"/>
|
||||
|
||||
<function name="BlendFuncSeparateOES" alias="BlendFuncSeparateEXT" static_dispatch="false">
|
||||
<param name="sfactorRGB" type="GLenum"/>
|
||||
<param name="dfactorRGB" type="GLenum"/>
|
||||
<param name="sfactorAlpha" type="GLenum"/>
|
||||
<param name="dfactorAlpha" type="GLenum"/>
|
||||
</function>
|
||||
</category>
|
||||
|
||||
<!-- part of es1.1 extension pack -->
|
||||
<category name="GL_OES_blend_subtract" number="3">
|
||||
<enum name="FUNC_ADD_OES" value="0x8006"/>
|
||||
<enum name="BLEND_EQUATION_OES" value="0x8009"/>
|
||||
<enum name="FUNC_SUBTRACT_OES" value="0x800A"/>
|
||||
<enum name="FUNC_REVERSE_SUBTRACT_OES" value="0x800B"/>
|
||||
|
||||
<function name="BlendEquationOES" alias="BlendEquation" static_dispatch="false">
|
||||
<param name="mode" type="GLenum"/>
|
||||
</function>
|
||||
</category>
|
||||
|
||||
<!-- core addition to es1.0 and later -->
|
||||
<category name="GL_OES_byte_coordinates" number="4">
|
||||
<enum name="BYTE" value="0x1400"/>
|
||||
</category>
|
||||
|
||||
<category name="GL_OES_compressed_paletted_texture" number="6">
|
||||
<enum name="PALETTE4_RGB8_OES" value="0x8B90"/>
|
||||
<enum name="PALETTE4_RGBA8_OES" value="0x8B91"/>
|
||||
<enum name="PALETTE4_R5_G6_B5_OES" value="0x8B92"/>
|
||||
<enum name="PALETTE4_RGBA4_OES" value="0x8B93"/>
|
||||
<enum name="PALETTE4_RGB5_A1_OES" value="0x8B94"/>
|
||||
<enum name="PALETTE8_RGB8_OES" value="0x8B95"/>
|
||||
<enum name="PALETTE8_RGBA8_OES" value="0x8B96"/>
|
||||
<enum name="PALETTE8_R5_G6_B5_OES" value="0x8B97"/>
|
||||
<enum name="PALETTE8_RGBA4_OES" value="0x8B98"/>
|
||||
<enum name="PALETTE8_RGB5_A1_OES" value="0x8B99"/>
|
||||
</category>
|
||||
|
||||
<!-- optional for es1.1 -->
|
||||
<category name="GL_OES_draw_texture" number="7">
|
||||
<enum name="TEXTURE_CROP_RECT_OES" value="0x8B9D"/>
|
||||
|
||||
<function name="DrawTexiOES" offset="assign" static_dispatch="false">
|
||||
<param name="x" type="GLint"/>
|
||||
<param name="y" type="GLint"/>
|
||||
<param name="z" type="GLint"/>
|
||||
<param name="width" type="GLint"/>
|
||||
<param name="height" type="GLint"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawTexivOES" offset="assign" static_dispatch="false">
|
||||
<param name="coords" type="const GLint *" count="5"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawTexfOES" offset="assign" static_dispatch="false">
|
||||
<param name="x" type="GLfloat"/>
|
||||
<param name="y" type="GLfloat"/>
|
||||
<param name="z" type="GLfloat"/>
|
||||
<param name="width" type="GLfloat"/>
|
||||
<param name="height" type="GLfloat"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawTexfvOES" offset="assign" static_dispatch="false">
|
||||
<param name="coords" type="const GLfloat *" count="5"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawTexsOES" offset="assign" static_dispatch="false">
|
||||
<param name="x" type="GLshort"/>
|
||||
<param name="y" type="GLshort"/>
|
||||
<param name="z" type="GLshort"/>
|
||||
<param name="width" type="GLshort"/>
|
||||
<param name="height" type="GLshort"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawTexsvOES" offset="assign" static_dispatch="false">
|
||||
<param name="coords" type="const GLshort *" count="5"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawTexxOES" offset="assign" static_dispatch="false">
|
||||
<param name="x" type="GLfixed"/>
|
||||
<param name="y" type="GLfixed"/>
|
||||
<param name="z" type="GLfixed"/>
|
||||
<param name="width" type="GLfixed"/>
|
||||
<param name="height" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="DrawTexxvOES" offset="assign" static_dispatch="false">
|
||||
<param name="coords" type="const GLfixed *" count="5"/>
|
||||
</function>
|
||||
|
||||
<!-- TexParameter{ifx}v is skipped here -->
|
||||
</category>
|
||||
|
||||
<!-- core addition to es1.0 and later -->
|
||||
<!-- 9. GL_OES_fixed_point -->
|
||||
|
||||
<!-- part of es1.1 extension pack -->
|
||||
<category name="GL_OES_framebuffer_object" number="10">
|
||||
<enum name="NONE_OES" value="0"/>
|
||||
<enum name="INVALID_FRAMEBUFFER_OPERATION_OES" value="0x0506"/>
|
||||
<enum name="RGBA4_OES" value="0x8056"/>
|
||||
<enum name="RGB5_A1_OES" value="0x8057"/>
|
||||
<enum name="DEPTH_COMPONENT16_OES" value="0x81A5"/>
|
||||
|
||||
<enum name="MAX_RENDERBUFFER_SIZE_OES" value="0x84E8"/>
|
||||
<enum name="FRAMEBUFFER_BINDING_OES" value="0x8CA6"/>
|
||||
<enum name="RENDERBUFFER_BINDING_OES" value="0x8CA7"/>
|
||||
<enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES" value="0x8CD0"/>
|
||||
<enum name="FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES" value="0x8CD1"/>
|
||||
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES" value="0x8CD2"/>
|
||||
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES" value="0x8CD3"/>
|
||||
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES" value="0x8CD4"/>
|
||||
<enum name="FRAMEBUFFER_COMPLETE_OES" value="0x8CD5"/>
|
||||
<enum name="FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES" value="0x8CD6"/>
|
||||
<enum name="FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES" value="0x8CD7"/>
|
||||
<enum name="FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES" value="0x8CD9"/>
|
||||
<enum name="FRAMEBUFFER_INCOMPLETE_FORMATS_OES" value="0x8CDA"/>
|
||||
<enum name="FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_OES" value="0x8CDB"/>
|
||||
<enum name="FRAMEBUFFER_INCOMPLETE_READ_BUFFER_OES" value="0x8CDC"/>
|
||||
<enum name="FRAMEBUFFER_UNSUPPORTED_OES" value="0x8CDD"/>
|
||||
<enum name="COLOR_ATTACHMENT0_OES" value="0x8CE0"/>
|
||||
<enum name="DEPTH_ATTACHMENT_OES" value="0x8D00"/>
|
||||
<enum name="STENCIL_ATTACHMENT_OES" value="0x8D20"/>
|
||||
<enum name="FRAMEBUFFER_OES" value="0x8D40"/>
|
||||
<enum name="RENDERBUFFER_OES" value="0x8D41"/>
|
||||
<enum name="RENDERBUFFER_WIDTH_OES" value="0x8D42"/>
|
||||
<enum name="RENDERBUFFER_HEIGHT_OES" value="0x8D43"/>
|
||||
<enum name="RENDERBUFFER_INTERNAL_FORMAT_OES" value="0x8D44"/>
|
||||
<enum name="STENCIL_INDEX1_OES" value="0x8D46"/>
|
||||
<enum name="STENCIL_INDEX4_OES" value="0x8D47"/>
|
||||
<enum name="STENCIL_INDEX8_OES" value="0x8D48"/>
|
||||
<enum name="RENDERBUFFER_RED_SIZE_OES" value="0x8D50"/>
|
||||
<enum name="RENDERBUFFER_GREEN_SIZE_OES" value="0x8D51"/>
|
||||
<enum name="RENDERBUFFER_BLUE_SIZE_OES" value="0x8D52"/>
|
||||
<enum name="RENDERBUFFER_ALPHA_SIZE_OES" value="0x8D53"/>
|
||||
<enum name="RENDERBUFFER_DEPTH_SIZE_OES" value="0x8D54"/>
|
||||
<enum name="RENDERBUFFER_STENCIL_SIZE_OES" value="0x8D55"/>
|
||||
<enum name="RGB565_OES" value="0x8D62"/>
|
||||
|
||||
<function name="BindFramebufferOES" alias="BindFramebufferEXT" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="framebuffer" type="GLuint"/>
|
||||
</function>
|
||||
|
||||
<function name="BindRenderbufferOES" alias="BindRenderbufferEXT" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="renderbuffer" type="GLuint"/>
|
||||
</function>
|
||||
|
||||
<function name="CheckFramebufferStatusOES" alias="CheckFramebufferStatusEXT" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<return type="GLenum"/>
|
||||
</function>
|
||||
|
||||
<function name="DeleteFramebuffersOES" alias="DeleteFramebuffersEXT" static_dispatch="false">
|
||||
<param name="n" type="GLsizei" counter="true"/>
|
||||
<param name="framebuffers" type="const GLuint *" count="n"/>
|
||||
</function>
|
||||
|
||||
<function name="DeleteRenderbuffersOES" alias="DeleteRenderbuffersEXT" static_dispatch="false">
|
||||
<param name="n" type="GLsizei" counter="true"/>
|
||||
<param name="renderbuffers" type="const GLuint *" count="n"/>
|
||||
</function>
|
||||
|
||||
<function name="FramebufferRenderbufferOES" alias="FramebufferRenderbufferEXT" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="attachment" type="GLenum"/>
|
||||
<param name="renderbuffertarget" type="GLenum"/>
|
||||
<param name="renderbuffer" type="GLuint"/>
|
||||
</function>
|
||||
|
||||
<function name="FramebufferTexture2DOES" alias="FramebufferTexture2DEXT" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="attachment" type="GLenum"/>
|
||||
<param name="textarget" type="GLenum"/>
|
||||
<param name="texture" type="GLuint"/>
|
||||
<param name="level" type="GLint"/>
|
||||
</function>
|
||||
|
||||
<function name="GenerateMipmapOES" alias="GenerateMipmapEXT" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
</function>
|
||||
|
||||
<function name="GenFramebuffersOES" alias="GenFramebuffersEXT" static_dispatch="false">
|
||||
<param name="n" type="GLsizei" counter="true"/>
|
||||
<param name="framebuffers" type="GLuint *" count="n" output="true"/>
|
||||
</function>
|
||||
|
||||
<function name="GenRenderbuffersOES" alias="GenRenderbuffersEXT" static_dispatch="false">
|
||||
<param name="n" type="GLsizei" counter="true"/>
|
||||
<param name="renderbuffers" type="GLuint *" count="n" output="true"/>
|
||||
</function>
|
||||
|
||||
<function name="GetFramebufferAttachmentParameterivOES" alias="GetFramebufferAttachmentParameterivEXT" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="attachment" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="GLint *" output="true"/>
|
||||
</function>
|
||||
|
||||
<function name="GetRenderbufferParameterivOES" alias="GetRenderbufferParameterivEXT" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="GLint *" output="true"/>
|
||||
</function>
|
||||
|
||||
<function name="IsFramebufferOES" alias="IsFramebufferEXT" static_dispatch="false">
|
||||
<param name="framebuffer" type="GLuint"/>
|
||||
<return type="GLboolean"/>
|
||||
</function>
|
||||
|
||||
<function name="IsRenderbufferOES" alias="IsRenderbufferEXT" static_dispatch="false">
|
||||
<param name="renderbuffer" type="GLuint"/>
|
||||
<return type="GLboolean"/>
|
||||
</function>
|
||||
|
||||
<function name="RenderbufferStorageOES" alias="RenderbufferStorageEXT" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="internalformat" type="GLenum"/>
|
||||
<param name="width" type="GLsizei"/>
|
||||
<param name="height" type="GLsizei"/>
|
||||
</function>
|
||||
</category>
|
||||
|
||||
<!-- core addition to es1.1 -->
|
||||
<category name="GL_OES_matrix_get" number="11">
|
||||
<enum name="MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898D"/>
|
||||
<enum name="PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898E"/>
|
||||
<enum name="TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES" value="0x898F"/>
|
||||
</category>
|
||||
|
||||
<!-- optional for es1.1 -->
|
||||
<category name="GL_OES_matrix_palette" number="12">
|
||||
<enum name="MAX_VERTEX_UNITS_OES" value="0x86A4"/>
|
||||
<enum name="WEIGHT_ARRAY_TYPE_OES" value="0x86A9"/>
|
||||
<enum name="WEIGHT_ARRAY_STRIDE_OES" value="0x86AA"/>
|
||||
<enum name="WEIGHT_ARRAY_SIZE_OES" value="0x86AB"/>
|
||||
<enum name="WEIGHT_ARRAY_POINTER_OES" value="0x86AC"/>
|
||||
<enum name="WEIGHT_ARRAY_OES" value="0x86AD"/>
|
||||
<enum name="MATRIX_PALETTE_OES" value="0x8840"/>
|
||||
<enum name="MAX_PALETTE_MATRICES_OES" value="0x8842"/>
|
||||
<enum name="CURRENT_PALETTE_MATRIX_OES" value="0x8843"/>
|
||||
<enum name="MATRIX_INDEX_ARRAY_OES" value="0x8844"/>
|
||||
<enum name="MATRIX_INDEX_ARRAY_SIZE_OES" value="0x8846"/>
|
||||
<enum name="MATRIX_INDEX_ARRAY_TYPE_OES" value="0x8847"/>
|
||||
<enum name="MATRIX_INDEX_ARRAY_STRIDE_OES" value="0x8848"/>
|
||||
<enum name="MATRIX_INDEX_ARRAY_POINTER_OES" value="0x8849"/>
|
||||
<enum name="WEIGHT_ARRAY_BUFFER_BINDING_OES" value="0x889E"/>
|
||||
<enum name="MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES" value="0x8B9E"/>
|
||||
|
||||
<function name="CurrentPaletteMatrixOES" alias="CurrentPaletteMatrixARB" static_dispatch="false">
|
||||
<param name="matrixpaletteindex" type="GLuint"/>
|
||||
</function>
|
||||
|
||||
<!-- no offset -->
|
||||
<function name="LoadPaletteFromModelViewMatrixOES" static_dispatch="false">
|
||||
</function>
|
||||
|
||||
<function name="MatrixIndexPointerOES" alias="MatrixIndexPointerARB" static_dispatch="false">
|
||||
<param name="size" type="GLint"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="stride" type="GLsizei"/>
|
||||
<param name="pointer" type="const GLvoid *"/>
|
||||
</function>
|
||||
|
||||
<function name="WeightPointerOES" alias="WeightPointerARB" static_dispatch="false">
|
||||
<param name="size" type="GLint"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="stride" type="GLsizei"/>
|
||||
<param name="pointer" type="const GLvoid *"/>
|
||||
</function>
|
||||
</category>
|
||||
|
||||
<!-- required for es1.1 -->
|
||||
<category name="GL_OES_point_size_array" number="14">
|
||||
<enum name="POINT_SIZE_ARRAY_TYPE_OES" value="0x898A"/>
|
||||
<enum name="POINT_SIZE_ARRAY_STRIDE_OES" value="0x898B"/>
|
||||
<enum name="POINT_SIZE_ARRAY_POINTER_OES" value="0x898C"/>
|
||||
<enum name="POINT_SIZE_ARRAY_OES" value="0x8B9C"/>
|
||||
<enum name="POINT_SIZE_ARRAY_BUFFER_BINDING_OES" value="0x8B9F"/>
|
||||
|
||||
<function name="PointSizePointerOES" offset="assign" static_dispatch="false">
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="stride" type="GLsizei"/>
|
||||
<param name="pointer" type="const GLvoid *"/>
|
||||
</function>
|
||||
</category>
|
||||
|
||||
<!-- required for es1.1 -->
|
||||
<category name="GL_OES_point_sprite" number="15">
|
||||
<enum name="POINT_SPRITE_OES" value="0x8861"/>
|
||||
<enum name="COORD_REPLACE_OES" value="0x8862"/>
|
||||
</category>
|
||||
|
||||
<!-- optional for es1.0 -->
|
||||
<category name="GL_OES_query_matrix" number="16">
|
||||
<function name="QueryMatrixxOES" offset="assign" static_dispatch="false">
|
||||
<param name="mantissa" type="GLfixed *" count="16" />
|
||||
<param name="exponent" type="GLint *" count="16" />
|
||||
<return type="GLbitfield"/>
|
||||
</function>
|
||||
</category>
|
||||
|
||||
<!-- required for es1.0 and later -->
|
||||
<!-- 17. GL_OES_read_format -->
|
||||
|
||||
<!-- core addition to es1.0 and later -->
|
||||
<!-- 18. GL_OES_single_precision -->
|
||||
|
||||
<!-- part of es1.1 extension pack -->
|
||||
<category name="GL_OES_texture_cube_map" number="20">
|
||||
<enum name="TEXTURE_GEN_MODE_OES" value="0x2500"/>
|
||||
<enum name="NORMAL_MAP_OES" value="0x8511"/>
|
||||
<enum name="REFLECTION_MAP_OES" value="0x8512"/>
|
||||
<enum name="TEXTURE_CUBE_MAP_OES" value="0x8513"/>
|
||||
<enum name="TEXTURE_BINDING_CUBE_MAP_OES" value="0x8514"/>
|
||||
<enum name="TEXTURE_CUBE_MAP_POSITIVE_X_OES" value="0x8515"/>
|
||||
<enum name="TEXTURE_CUBE_MAP_NEGATIVE_X_OES" value="0x8516"/>
|
||||
<enum name="TEXTURE_CUBE_MAP_POSITIVE_Y_OES" value="0x8517"/>
|
||||
<enum name="TEXTURE_CUBE_MAP_NEGATIVE_Y_OES" value="0x8518"/>
|
||||
<enum name="TEXTURE_CUBE_MAP_POSITIVE_Z_OES" value="0x8519"/>
|
||||
<enum name="TEXTURE_CUBE_MAP_NEGATIVE_Z_OES" value="0x851A"/>
|
||||
<enum name="MAX_CUBE_MAP_TEXTURE_SIZE_OES" value="0x851C"/>
|
||||
<enum name="TEXTURE_GEN_STR_OES" value="0x8D60"/>
|
||||
|
||||
<function name="GetTexGenfvOES" alias="GetTexGenfv" static_dispatch="false">
|
||||
<param name="coord" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="GLfloat *" output="true" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="GetTexGenivOES" alias="GetTexGeniv" static_dispatch="false">
|
||||
<param name="coord" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="GLint *" output="true" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="TexGenfOES" alias="TexGenf" static_dispatch="false">
|
||||
<param name="coord" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="param" type="GLfloat"/>
|
||||
</function>
|
||||
|
||||
<function name="TexGenfvOES" alias="TexGenfv" static_dispatch="false">
|
||||
<param name="coord" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="const GLfloat *" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="TexGeniOES" alias="TexGeni" static_dispatch="false">
|
||||
<param name="coord" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="param" type="GLint"/>
|
||||
</function>
|
||||
|
||||
<function name="TexGenivOES" alias="TexGeniv" static_dispatch="false">
|
||||
<param name="coord" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="const GLint *" variable_param="pname"/>
|
||||
</function>
|
||||
</category>
|
||||
|
||||
<category name="GL_OES_texture_env_crossbar" number="21">
|
||||
<!-- No new functions, types, enums. -->
|
||||
</category>
|
||||
|
||||
<category name="GL_OES_texture_mirrored_repeat" number="22">
|
||||
<!-- No new functions, types, enums. -->
|
||||
</category>
|
||||
|
||||
<!-- 23. GL_OES_EGL_image -->
|
||||
|
||||
<category name="GL_OES_depth24" number="24">
|
||||
<enum name="DEPTH_COMPONENT24_OES" value="0x81A6"/>
|
||||
</category>
|
||||
|
||||
<category name="GL_OES_depth32" number="25">
|
||||
<enum name="DEPTH_COMPONENT32_OES" value="0x81A7"/>
|
||||
</category>
|
||||
|
||||
<!-- 26. GL_OES_element_index_uint -->
|
||||
|
||||
<!-- 27. GL_OES_fbo_render_mipmap -->
|
||||
|
||||
<category name="GL_OES_mapbuffer" number="29">
|
||||
<enum name="WRITE_ONLY_OES" value="0x88B9"/>
|
||||
<enum name="BUFFER_ACCESS_OES" value="0x88BB"/>
|
||||
<enum name="BUFFER_MAPPED_OES" value="0x88BC"/>
|
||||
<enum name="BUFFER_MAP_POINTER_OES" value="0x88BD"/>
|
||||
|
||||
<function name="GetBufferPointervOES" alias="GetBufferPointervARB" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="GLvoid **"/>
|
||||
</function>
|
||||
|
||||
<function name="MapBufferOES" alias="MapBufferARB" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="access" type="GLenum"/>
|
||||
<return type="GLvoid *"/>
|
||||
</function>
|
||||
|
||||
<function name="UnmapBufferOES" alias="UnmapBufferARB" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<return type="GLboolean"/>
|
||||
</function>
|
||||
</category>
|
||||
|
||||
<category name="GL_OES_rgb8_rgba8" number="30">
|
||||
<enum name="RGB8_OES" value="0x8051"/>
|
||||
<enum name="RGBA8_OES" value="0x8058"/>
|
||||
</category>
|
||||
|
||||
<category name="GL_OES_stencil1" number="31">
|
||||
<enum name="STENCIL_INDEX1_OES" value="0x8D46"/>
|
||||
</category>
|
||||
|
||||
<category name="GL_OES_stencil4" number="32">
|
||||
<enum name="STENCIL_INDEX4_OES" value="0x8D47"/>
|
||||
</category>
|
||||
|
||||
<category name="GL_OES_stencil8" number="33">
|
||||
<enum name="STENCIL_INDEX8_OES" value="0x8D48"/>
|
||||
</category>
|
||||
|
||||
<category name="GL_OES_texture_3D" number="34">
|
||||
<enum name="TEXTURE_BINDING_3D_OES" value="0x806A"/>
|
||||
<enum name="TEXTURE_3D_OES" value="0x806F"/>
|
||||
<enum name="TEXTURE_WRAP_R_OES" value="0x8072"/>
|
||||
<enum name="MAX_3D_TEXTURE_SIZE_OES" value="0x8073"/>
|
||||
<enum name="SAMPLER_3D_OES" value="0x8B5F"/>
|
||||
<enum name="FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES" value="0x8CD4"/>
|
||||
|
||||
<function name="CompressedTexImage3DOES" alias="CompressedTexImage3DARB" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="level" type="GLint"/>
|
||||
<param name="internalformat" type="GLenum"/>
|
||||
<param name="width" type="GLsizei"/>
|
||||
<param name="height" type="GLsizei"/>
|
||||
<param name="depth" type="GLsizei"/>
|
||||
<param name="border" type="GLint"/>
|
||||
<param name="imageSize" type="GLsizei" counter="true"/>
|
||||
<param name="data" type="const GLvoid *" count="imageSize"/>
|
||||
</function>
|
||||
|
||||
<function name="CompressedTexSubImage3DOES" alias="CompressedTexSubImage3DARB" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="level" type="GLint"/>
|
||||
<param name="xoffset" type="GLint"/>
|
||||
<param name="yoffset" type="GLint"/>
|
||||
<param name="zoffset" type="GLint"/>
|
||||
<param name="width" type="GLsizei"/>
|
||||
<param name="height" type="GLsizei"/>
|
||||
<param name="depth" type="GLsizei"/>
|
||||
<param name="format" type="GLenum"/>
|
||||
<param name="imageSize" type="GLsizei" counter="true"/>
|
||||
<param name="data" type="const GLvoid *" count="imageSize"/>
|
||||
</function>
|
||||
|
||||
<function name="CopyTexSubImage3DOES" alias="CopyTexSubImage3D" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="level" type="GLint"/>
|
||||
<param name="xoffset" type="GLint"/>
|
||||
<param name="yoffset" type="GLint"/>
|
||||
<param name="zoffset" type="GLint"/>
|
||||
<param name="x" type="GLint"/>
|
||||
<param name="y" type="GLint"/>
|
||||
<param name="width" type="GLsizei"/>
|
||||
<param name="height" type="GLsizei"/>
|
||||
</function>
|
||||
|
||||
<function name="FramebufferTexture3DOES" alias="FramebufferTexture3DEXT" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="attachment" type="GLenum"/>
|
||||
<param name="textarget" type="GLenum"/>
|
||||
<param name="texture" type="GLuint"/>
|
||||
<param name="level" type="GLint"/>
|
||||
<param name="zoffset" type="GLint"/>
|
||||
</function>
|
||||
|
||||
<function name="TexImage3DOES" alias="TexImage3D" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="level" type="GLint"/>
|
||||
<param name="internalformat" type="GLenum"/>
|
||||
<param name="width" type="GLsizei"/>
|
||||
<param name="height" type="GLsizei"/>
|
||||
<param name="depth" type="GLsizei"/>
|
||||
<param name="border" type="GLint"/>
|
||||
<param name="format" type="GLenum"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_format="format" img_type="type" img_target="target" img_null_flag="true" img_pad_dimensions="true"/>
|
||||
</function>
|
||||
|
||||
<function name="TexSubImage3DOES" alias="TexSubImage3D" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="level" type="GLint"/>
|
||||
<param name="xoffset" type="GLint"/>
|
||||
<param name="yoffset" type="GLint"/>
|
||||
<param name="zoffset" type="GLint"/>
|
||||
<param name="width" type="GLsizei"/>
|
||||
<param name="height" type="GLsizei"/>
|
||||
<param name="depth" type="GLsizei"/>
|
||||
<param name="format" type="GLenum"/>
|
||||
<param name="type" type="GLenum"/>
|
||||
<param name="UNUSED" type="GLuint" padding="true"/>
|
||||
<param name="pixels" type="const GLvoid *" img_width="width" img_height="height" img_depth="depth" img_xoff="xoffset" img_yoff="yoffset" img_zoff="zoffset" img_format="format" img_type="type" img_target="target" img_pad_dimensions="true"/>
|
||||
</function>
|
||||
</category>
|
||||
|
||||
<!-- the other name is OES_texture_float_linear -->
|
||||
<!-- 35. GL_OES_texture_half_float_linear -->
|
||||
|
||||
<!-- the other name is OES_texture_float -->
|
||||
<category name="GL_OES_texture_half_float" number="36">
|
||||
<enum name="HALF_FLOAT_OES" value="0x8D61"/>
|
||||
</category>
|
||||
|
||||
<!-- 37. GL_OES_texture_npot -->
|
||||
|
||||
<category name="GL_OES_vertex_half_float" number="38">
|
||||
<enum name="HALF_FLOAT_OES" value="0x8D61"/>
|
||||
</category>
|
||||
|
||||
<!-- 41. GL_EXT_texture_filter_anisotropic -->
|
||||
|
||||
<category name="GL_EXT_texture_type_2_10_10_10_REV" number="42">
|
||||
<enum name="UNSIGNED_INT_2_10_10_10_REV_EXT" value="0x8368"/>
|
||||
</category>
|
||||
|
||||
<category name="GL_OES_packed_depth_stencil" number="43">
|
||||
<enum name="DEPTH_STENCIL_OES" value="0x84F9"/>
|
||||
<enum name="UNSIGNED_INT_24_8_OES" value="0x84FA"/>
|
||||
<enum name="DEPTH24_STENCIL8_OES" value="0x88F0"/>
|
||||
</category>
|
||||
|
||||
<!-- 44. GL_OES_depth_texture -->
|
||||
|
||||
<category name="GL_OES_standard_derivatives" number="45">
|
||||
<enum name="FRAGMENT_SHADER_DERIVATIVE_HINT_OES" value="0x8B8B"/>
|
||||
</category>
|
||||
|
||||
<category name="GL_OES_vertex_type_10_10_10_2" number="46">
|
||||
<enum name="UNSIGNED_INT_10_10_10_2_OES" value="0x8DF6"/>
|
||||
<enum name="INT_10_10_10_2_OES" value="0x8DF7"/>
|
||||
</category>
|
||||
|
||||
<category name="GL_OES_get_program_binary" number="47">
|
||||
<enum name="PROGRAM_BINARY_LENGTH_OES" value="0x8741"/>
|
||||
<enum name="NUM_PROGRAM_BINARY_FORMATS_OES" value="0x87FE"/>
|
||||
<enum name="PROGRAM_BINARY_FORMATS_OES" value="0x87FF"/>
|
||||
|
||||
<function name="GetProgramBinaryOES" alias="GetProgramBinary" static_dispatch="false">
|
||||
<param name="program" type="GLuint"/>
|
||||
<param name="bufSize" type="GLsizei"/>
|
||||
<param name="length" type="GLsizei *"/>
|
||||
<param name="binaryFormat" type="GLenum *"/>
|
||||
<param name="binary" type="GLvoid *"/>
|
||||
</function>
|
||||
|
||||
<function name="ProgramBinaryOES" alias="ProgramBinary" static_dispatch="false">
|
||||
<param name="program" type="GLuint"/>
|
||||
<param name="binaryFormat" type="GLenum"/>
|
||||
<param name="binary" type="const GLvoid *"/>
|
||||
<param name="length" type="GLint"/>
|
||||
</function>
|
||||
</category>
|
||||
|
||||
<category name="GL_EXT_texture_compression_dxt1" number="49">
|
||||
<enum name="COMPRESSED_RGB_S3TC_DXT1_EXT" value="0x83F0"/>
|
||||
<enum name="COMPRESSED_RGBA_S3TC_DXT1_EXT" value="0x83F1"/>
|
||||
</category>
|
||||
|
||||
<category name="GL_EXT_texture_format_BGRA8888" number="51">
|
||||
<enum name="BGRA_EXT" value="0x80E1"/>
|
||||
</category>
|
||||
|
||||
<category name="GL_EXT_texture_lod_bias" number="60">
|
||||
<enum name="TEXTURE_FILTER_CONTROL_EXT" value="0x8500"/>
|
||||
<enum name="TEXTURE_LOD_BIAS_EXT" value="0x8501"/>
|
||||
<enum name="MAX_TEXTURE_LOD_BIAS_EXT" value="0x84FD"/>
|
||||
</category>
|
||||
|
||||
<!-- 65. GL_EXT_blend_minmax -->
|
||||
|
||||
<category name="GL_EXT_read_format_bgra" number="66">
|
||||
<enum name="BGRA_EXT" value="0x80E1"/>
|
||||
<enum name="UNSIGNED_SHORT_4_4_4_4_REV_EXT" value="0x8365"/>
|
||||
<enum name="UNSIGNED_SHORT_1_5_5_5_REV_EXT" value="0x8366"/>
|
||||
</category>
|
||||
|
||||
<!-- 69. GL_EXT_multi_draw_arrays -->
|
||||
|
||||
</OpenGLAPI>
|
||||
@@ -350,6 +350,55 @@ const GLuint __glXDefaultPixelStore[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 1 };
|
||||
if func.glx_sop and func.glx_vendorpriv:
|
||||
self.printFunction(func, func.glx_vendorpriv_names[0])
|
||||
|
||||
self.printGetProcAddress(api)
|
||||
return
|
||||
|
||||
def printGetProcAddress(self, api):
|
||||
procs = {}
|
||||
for func in api.functionIterateGlx():
|
||||
for n in func.entry_points:
|
||||
if func.has_different_protocol(n):
|
||||
procs[n] = func.static_glx_name(n)
|
||||
|
||||
print """
|
||||
#ifdef GLX_SHARED_GLAPI
|
||||
|
||||
static const struct proc_pair
|
||||
{
|
||||
const char *name;
|
||||
_glapi_proc proc;
|
||||
} proc_pairs[%d] = {""" % len(procs)
|
||||
names = procs.keys()
|
||||
names.sort()
|
||||
for i in xrange(len(names)):
|
||||
comma = ',' if i < len(names) - 1 else ''
|
||||
print ' { "%s", (_glapi_proc) gl%s }%s' % (names[i], procs[names[i]], comma)
|
||||
print """};
|
||||
|
||||
static int
|
||||
__indirect_get_proc_compare(const void *key, const void *memb)
|
||||
{
|
||||
const struct proc_pair *pair = (const struct proc_pair *) memb;
|
||||
return strcmp((const char *) key, pair->name);
|
||||
}
|
||||
|
||||
_glapi_proc
|
||||
__indirect_get_proc_address(const char *name)
|
||||
{
|
||||
const struct proc_pair *pair;
|
||||
|
||||
/* skip "gl" */
|
||||
name += 2;
|
||||
|
||||
pair = (const struct proc_pair *) bsearch((const void *) name,
|
||||
(const void *) proc_pairs, ARRAY_SIZE(proc_pairs), sizeof(proc_pairs[0]),
|
||||
__indirect_get_proc_compare);
|
||||
|
||||
return (pair) ? pair->proc : NULL;
|
||||
}
|
||||
|
||||
#endif /* GLX_SHARED_GLAPI */
|
||||
"""
|
||||
return
|
||||
|
||||
|
||||
@@ -1001,6 +1050,10 @@ extern HIDDEN NOINLINE FASTCALL GLubyte * __glXSetupVendorRequest(
|
||||
|
||||
break
|
||||
|
||||
print ''
|
||||
print '#ifdef GLX_SHARED_GLAPI'
|
||||
print 'extern HIDDEN void (*__indirect_get_proc_address(const char *name))(void);'
|
||||
print '#endif'
|
||||
|
||||
|
||||
def show_usage():
|
||||
|
||||
@@ -0,0 +1,286 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE OpenGLAPI SYSTEM "gl_API.dtd">
|
||||
|
||||
<!-- OpenGL + OpenGL ES -->
|
||||
|
||||
<OpenGLAPI>
|
||||
|
||||
<xi:include href="gl_API.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
|
||||
<!-- these can be moved to gl_API.xml -->
|
||||
<xi:include href="ARB_get_program_binary.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
<xi:include href="OES_fixed_point.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
<xi:include href="OES_single_precision.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
|
||||
<category name="es1.0">
|
||||
<!-- from GL_OES_fixed_point -->
|
||||
<enum name="FIXED" value="0x140C"/>
|
||||
|
||||
<type name="fixed" size="4" />
|
||||
<type name="clampx" size="4" />
|
||||
|
||||
<function name="AlphaFuncx" alias="AlphaFuncxOES" static_dispatch="false">
|
||||
<param name="func" type="GLenum"/>
|
||||
<param name="ref" type="GLclampx"/>
|
||||
</function>
|
||||
|
||||
<function name="ClearColorx" alias="ClearColorxOES" static_dispatch="false">
|
||||
<param name="red" type="GLclampx"/>
|
||||
<param name="green" type="GLclampx"/>
|
||||
<param name="blue" type="GLclampx"/>
|
||||
<param name="alpha" type="GLclampx"/>
|
||||
</function>
|
||||
|
||||
<function name="ClearDepthx" alias="ClearDepthxOES" static_dispatch="false">
|
||||
<param name="depth" type="GLclampx"/>
|
||||
</function>
|
||||
|
||||
<function name="Color4x" alias="Color4xOES" static_dispatch="false">
|
||||
<param name="red" type="GLfixed"/>
|
||||
<param name="green" type="GLfixed"/>
|
||||
<param name="blue" type="GLfixed"/>
|
||||
<param name="alpha" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="DepthRangex" alias="DepthRangexOES" static_dispatch="false">
|
||||
<param name="zNear" type="GLclampx"/>
|
||||
<param name="zFar" type="GLclampx"/>
|
||||
</function>
|
||||
|
||||
<function name="Fogx" alias="FogxOES" static_dispatch="false">
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="param" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="Fogxv" alias="FogxvOES" static_dispatch="false">
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="const GLfixed *" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="Frustumx" alias="FrustumxOES" static_dispatch="false">
|
||||
<param name="left" type="GLfixed"/>
|
||||
<param name="right" type="GLfixed"/>
|
||||
<param name="bottom" type="GLfixed"/>
|
||||
<param name="top" type="GLfixed"/>
|
||||
<param name="zNear" type="GLfixed"/>
|
||||
<param name="zFar" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="LightModelx" alias="LightModelxOES" static_dispatch="false">
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="param" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="LightModelxv" alias="LightModelxvOES" static_dispatch="false">
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="const GLfixed *" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="Lightx" alias="LightxOES" static_dispatch="false">
|
||||
<param name="light" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="param" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="Lightxv" alias="LightxvOES" static_dispatch="false">
|
||||
<param name="light" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="const GLfixed *" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="LineWidthx" alias="LineWidthxOES" static_dispatch="false">
|
||||
<param name="width" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="LoadMatrixx" alias="LoadMatrixxOES" static_dispatch="false">
|
||||
<param name="m" type="const GLfixed *" count="16"/>
|
||||
</function>
|
||||
|
||||
<function name="Materialx" alias="MaterialxOES" static_dispatch="false">
|
||||
<param name="face" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="param" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="Materialxv" alias="MaterialxvOES" static_dispatch="false">
|
||||
<param name="face" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="const GLfixed *" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="MultMatrixx" alias="MultMatrixxOES" static_dispatch="false">
|
||||
<param name="m" type="const GLfixed *" count="16"/>
|
||||
</function>
|
||||
|
||||
<function name="MultiTexCoord4x" alias="MultiTexCoord4xOES" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="s" type="GLfixed"/>
|
||||
<param name="t" type="GLfixed"/>
|
||||
<param name="r" type="GLfixed"/>
|
||||
<param name="q" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="Normal3x" alias="Normal3xOES" static_dispatch="false">
|
||||
<param name="nx" type="GLfixed"/>
|
||||
<param name="ny" type="GLfixed"/>
|
||||
<param name="nz" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="Orthox" alias="OrthoxOES" static_dispatch="false">
|
||||
<param name="left" type="GLfixed"/>
|
||||
<param name="right" type="GLfixed"/>
|
||||
<param name="bottom" type="GLfixed"/>
|
||||
<param name="top" type="GLfixed"/>
|
||||
<param name="zNear" type="GLfixed"/>
|
||||
<param name="zFar" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="PointSizex" alias="PointSizexOES" static_dispatch="false">
|
||||
<param name="size" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="PolygonOffsetx" alias="PolygonOffsetxOES" static_dispatch="false">
|
||||
<param name="factor" type="GLfixed"/>
|
||||
<param name="units" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="Rotatex" alias="RotatexOES" static_dispatch="false">
|
||||
<param name="angle" type="GLfixed"/>
|
||||
<param name="x" type="GLfixed"/>
|
||||
<param name="y" type="GLfixed"/>
|
||||
<param name="z" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="SampleCoveragex" alias="SampleCoveragexOES" static_dispatch="false">
|
||||
<param name="value" type="GLclampx"/>
|
||||
<param name="invert" type="GLboolean"/>
|
||||
</function>
|
||||
|
||||
<function name="Scalex" alias="ScalexOES" static_dispatch="false">
|
||||
<param name="x" type="GLfixed"/>
|
||||
<param name="y" type="GLfixed"/>
|
||||
<param name="z" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="TexEnvx" alias="TexEnvxOES" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="param" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="TexEnvxv" alias="TexEnvxvOES" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="const GLfixed *" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="TexParameterx" alias="TexParameterxOES" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="param" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="Translatex" alias="TranslatexOES" static_dispatch="false">
|
||||
<param name="x" type="GLfixed"/>
|
||||
<param name="y" type="GLfixed"/>
|
||||
<param name="z" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<!-- from GL_OES_single_precision -->
|
||||
<function name="Frustumf" alias="FrustumfOES" static_dispatch="false">
|
||||
<param name="left" type="GLfloat"/>
|
||||
<param name="right" type="GLfloat"/>
|
||||
<param name="bottom" type="GLfloat"/>
|
||||
<param name="top" type="GLfloat"/>
|
||||
<param name="zNear" type="GLfloat"/>
|
||||
<param name="zFar" type="GLfloat"/>
|
||||
</function>
|
||||
|
||||
<function name="Orthof" alias="OrthofOES" static_dispatch="false">
|
||||
<param name="left" type="GLfloat"/>
|
||||
<param name="right" type="GLfloat"/>
|
||||
<param name="bottom" type="GLfloat"/>
|
||||
<param name="top" type="GLfloat"/>
|
||||
<param name="zNear" type="GLfloat"/>
|
||||
<param name="zFar" type="GLfloat"/>
|
||||
</function>
|
||||
</category>
|
||||
|
||||
<category name="es1.1">
|
||||
<!-- from GL_OES_fixed_point -->
|
||||
<function name="ClipPlanex" alias="ClipPlanexOES" static_dispatch="false">
|
||||
<param name="plane" type="GLenum"/>
|
||||
<param name="equation" type="const GLfixed *" count="4"/>
|
||||
</function>
|
||||
|
||||
<function name="GetClipPlanex" alias="GetClipPlanexOES" static_dispatch="false">
|
||||
<param name="plane" type="GLenum"/>
|
||||
<param name="equation" type="GLfixed *" output="true" count="4"/>
|
||||
</function>
|
||||
|
||||
<function name="GetFixedv" alias="GetFixedvOES" static_dispatch="false">
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="GLfixed *" output="true" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="GetLightxv" alias="GetLightxvOES" static_dispatch="false">
|
||||
<param name="light" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="GLfixed *" output="true" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="GetMaterialxv" alias="GetMaterialxvOES" static_dispatch="false">
|
||||
<param name="face" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="GLfixed *" output="true" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="GetTexEnvxv" alias="GetTexEnvxvOES" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="GLfixed *" output="true" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="GetTexParameterxv" alias="GetTexParameterxvOES" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="GLfixed *" output="true" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<function name="PointParameterx" alias="PointParameterxOES" static_dispatch="false">
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="param" type="GLfixed"/>
|
||||
</function>
|
||||
|
||||
<function name="PointParameterxv" alias="PointParameterxvOES" static_dispatch="false">
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="const GLfixed *"/>
|
||||
</function>
|
||||
|
||||
<function name="TexParameterxv" alias="TexParameterxvOES" static_dispatch="false">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="pname" type="GLenum"/>
|
||||
<param name="params" type="const GLfixed *" variable_param="pname"/>
|
||||
</function>
|
||||
|
||||
<!-- from GL_OES_single_precision -->
|
||||
<function name="ClipPlanef" alias="ClipPlanefOES" static_dispatch="false">
|
||||
<param name="plane" type="GLenum"/>
|
||||
<param name="equation" type="const GLfloat *" count="4"/>
|
||||
</function>
|
||||
|
||||
<function name="GetClipPlanef" alias="GetClipPlanefOES" static_dispatch="false">
|
||||
<param name="plane" type="GLenum"/>
|
||||
<param name="equation" type="GLfloat *" output="true" count="4"/>
|
||||
</function>
|
||||
</category>
|
||||
|
||||
<category name="es2.0">
|
||||
<!-- enums missing from GL_ARB_framebuffer_object and GL_EXT_framebuffer_object -->
|
||||
<enum name="FRAMEBUFFER_INCOMPLETE_DIMENSIONS" value="0x8CD9"/>
|
||||
<enum name="RGB565" value="0x8D62"/>
|
||||
</category>
|
||||
|
||||
<xi:include href="es_EXT.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
|
||||
|
||||
</OpenGLAPI>
|
||||
@@ -46,6 +46,7 @@ class PrintGlEnums(gl_XML.gl_print_base):
|
||||
print '#include "main/mfeatures.h"'
|
||||
print '#include "main/enums.h"'
|
||||
print '#include "main/imports.h"'
|
||||
print '#include "main/mtypes.h"'
|
||||
print ''
|
||||
print 'typedef struct {'
|
||||
print ' size_t offset;'
|
||||
@@ -111,29 +112,39 @@ const char *_mesa_lookup_enum_by_nr( int nr )
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Primitive names
|
||||
*/
|
||||
static const char *prim_names[PRIM_UNKNOWN + 1] = {
|
||||
"GL_POINTS",
|
||||
"GL_LINES",
|
||||
"GL_LINE_LOOP",
|
||||
"GL_LINE_STRIP",
|
||||
"GL_TRIANGLES",
|
||||
"GL_TRIANGLE_STRIP",
|
||||
"GL_TRIANGLE_FAN",
|
||||
"GL_QUADS",
|
||||
"GL_QUAD_STRIP",
|
||||
"GL_POLYGON",
|
||||
"outside begin/end",
|
||||
"inside unknown primitive",
|
||||
"unknown state"
|
||||
};
|
||||
|
||||
|
||||
/* Get the name of an enum given that it is a primitive type. Avoids
|
||||
* GL_FALSE/GL_POINTS ambiguity and others.
|
||||
*/
|
||||
const char *_mesa_lookup_prim_by_nr( int nr )
|
||||
const char *
|
||||
_mesa_lookup_prim_by_nr(GLuint nr)
|
||||
{
|
||||
switch (nr) {
|
||||
case GL_POINTS: return "GL_POINTS";
|
||||
case GL_LINES: return "GL_LINES";
|
||||
case GL_LINE_STRIP: return "GL_LINE_STRIP";
|
||||
case GL_LINE_LOOP: return "GL_LINE_LOOP";
|
||||
case GL_TRIANGLES: return "GL_TRIANGLES";
|
||||
case GL_TRIANGLE_STRIP: return "GL_TRIANGLE_STRIP";
|
||||
case GL_TRIANGLE_FAN: return "GL_TRIANGLE_FAN";
|
||||
case GL_QUADS: return "GL_QUADS";
|
||||
case GL_QUAD_STRIP: return "GL_QUAD_STRIP";
|
||||
case GL_POLYGON: return "GL_POLYGON";
|
||||
case GL_POLYGON+1: return "OUTSIDE_BEGIN_END";
|
||||
default: return "<invalid>";
|
||||
}
|
||||
if (nr < Elements(prim_names))
|
||||
return prim_names[nr];
|
||||
else
|
||||
return "invalid mode";
|
||||
}
|
||||
|
||||
|
||||
|
||||
int _mesa_lookup_enum_by_name( const char *symbol )
|
||||
{
|
||||
enum_elt * f = NULL;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+26
-1
@@ -27,6 +27,18 @@
|
||||
*/
|
||||
|
||||
#include "entry.h"
|
||||
#include "u_current.h"
|
||||
#include "u_macros.h"
|
||||
|
||||
/* define macros for use by assembly dispatchers */
|
||||
#define ENTRY_CURRENT_TABLE U_STRINGIFY(u_current_table)
|
||||
|
||||
/* in bridge mode, mapi is a user of glapi */
|
||||
#ifdef MAPI_MODE_BRIDGE
|
||||
#define ENTRY_CURRENT_TABLE_GET "_glapi_get_dispatch"
|
||||
#else
|
||||
#define ENTRY_CURRENT_TABLE_GET "u_current_get_internal"
|
||||
#endif
|
||||
|
||||
#if defined(USE_X86_ASM) && defined(__GNUC__)
|
||||
# ifdef GLX_USE_TLS
|
||||
@@ -39,7 +51,16 @@
|
||||
#else
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "u_current.h"
|
||||
|
||||
static INLINE const struct mapi_table *
|
||||
entry_current_get(void)
|
||||
{
|
||||
#ifdef MAPI_MODE_BRIDGE
|
||||
return GET_DISPATCH();
|
||||
#else
|
||||
return u_current_get();
|
||||
#endif
|
||||
}
|
||||
|
||||
/* C version of the public entries */
|
||||
#define MAPI_TMP_DEFINES
|
||||
@@ -47,6 +68,8 @@
|
||||
#define MAPI_TMP_PUBLIC_ENTRIES
|
||||
#include "mapi_tmp.h"
|
||||
|
||||
#ifndef MAPI_MODE_BRIDGE
|
||||
|
||||
void
|
||||
entry_patch_public(void)
|
||||
{
|
||||
@@ -70,4 +93,6 @@ entry_patch(mapi_func entry, int slot)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* MAPI_MODE_BRIDGE */
|
||||
|
||||
#endif /* asm */
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
* Chia-I Wu <olv@lunarg.com>
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "u_execmem.h"
|
||||
#include "u_macros.h"
|
||||
|
||||
#ifdef __linux__
|
||||
@@ -43,13 +41,8 @@ __asm__(".section .note.ABI-tag, \"a\"\n\t"
|
||||
"3: .p2align 2\n\t"); /* pad out section */
|
||||
#endif /* __linux__ */
|
||||
|
||||
__asm__(".text");
|
||||
|
||||
__asm__("x86_64_current_tls:\n\t"
|
||||
"movq u_current_table@GOTTPOFF(%rip), %rax\n\t"
|
||||
"ret");
|
||||
|
||||
__asm__(".balign 32\n"
|
||||
__asm__(".text\n"
|
||||
".balign 32\n"
|
||||
"x86_64_entry_start:");
|
||||
|
||||
#define STUB_ASM_ENTRY(func) \
|
||||
@@ -59,16 +52,25 @@ __asm__(".balign 32\n"
|
||||
func ":"
|
||||
|
||||
#define STUB_ASM_CODE(slot) \
|
||||
"movq u_current_table@GOTTPOFF(%rip), %rax\n\t" \
|
||||
"movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t" \
|
||||
"movq %fs:(%rax), %r11\n\t" \
|
||||
"jmp *(8 * " slot ")(%r11)"
|
||||
|
||||
#define MAPI_TMP_STUB_ASM_GCC
|
||||
#include "mapi_tmp.h"
|
||||
|
||||
#ifndef MAPI_MODE_BRIDGE
|
||||
|
||||
__asm__("x86_64_current_tls:\n\t"
|
||||
"movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t"
|
||||
"ret");
|
||||
|
||||
extern unsigned long
|
||||
x86_64_current_tls();
|
||||
|
||||
#include <string.h>
|
||||
#include "u_execmem.h"
|
||||
|
||||
void
|
||||
entry_patch_public(void)
|
||||
{
|
||||
@@ -118,3 +120,5 @@ entry_generate(int slot)
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
#endif /* MAPI_MODE_BRIDGE */
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "u_execmem.h"
|
||||
#include "u_macros.h"
|
||||
|
||||
#ifdef __linux__
|
||||
@@ -50,7 +49,7 @@ __asm__("x86_current_tls:\n\t"
|
||||
"1:\n\t"
|
||||
"popl %eax\n\t"
|
||||
"addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax\n\t"
|
||||
"movl u_current_table@GOTNTPOFF(%eax), %eax\n\t"
|
||||
"movl " ENTRY_CURRENT_TABLE "@GOTNTPOFF(%eax), %eax\n\t"
|
||||
"ret");
|
||||
|
||||
#ifndef GLX_X86_READONLY_TEXT
|
||||
@@ -80,6 +79,10 @@ __asm__(".balign 16\n"
|
||||
__asm__(".text");
|
||||
#endif /* GLX_X86_READONLY_TEXT */
|
||||
|
||||
#ifndef MAPI_MODE_BRIDGE
|
||||
|
||||
#include "u_execmem.h"
|
||||
|
||||
extern unsigned long
|
||||
x86_current_tls();
|
||||
|
||||
@@ -139,3 +142,5 @@ entry_generate(int slot)
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
#endif /* MAPI_MODE_BRIDGE */
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
* Chia-I Wu <olv@lunarg.com>
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "u_execmem.h"
|
||||
#include "u_macros.h"
|
||||
|
||||
#define X86_ENTRY_SIZE 32
|
||||
@@ -43,20 +41,25 @@ __asm__(".text\n"
|
||||
func ":"
|
||||
|
||||
#define STUB_ASM_CODE(slot) \
|
||||
"movl u_current_table, %eax\n\t" \
|
||||
"movl " ENTRY_CURRENT_TABLE ", %eax\n\t" \
|
||||
"testl %eax, %eax\n\t" \
|
||||
"je 1f\n\t" \
|
||||
"jmp *(4 * " slot ")(%eax)\n" \
|
||||
"1:\n\t" \
|
||||
"call u_current_get_internal\n\t"\
|
||||
"call " ENTRY_CURRENT_TABLE_GET "\n\t" \
|
||||
"jmp *(4 * " slot ")(%eax)"
|
||||
|
||||
#define MAPI_TMP_STUB_ASM_GCC
|
||||
#include "mapi_tmp.h"
|
||||
|
||||
#ifndef MAPI_MODE_BRIDGE
|
||||
|
||||
__asm__(".balign 32\n"
|
||||
"x86_entry_end:");
|
||||
|
||||
#include <string.h>
|
||||
#include "u_execmem.h"
|
||||
|
||||
void
|
||||
entry_patch_public(void)
|
||||
{
|
||||
@@ -96,3 +99,5 @@ entry_generate(int slot)
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
#endif /* MAPI_MODE_BRIDGE */
|
||||
|
||||
+661
-42
@@ -126,6 +126,61 @@ class ABIEntry(object):
|
||||
|
||||
return res
|
||||
|
||||
def abi_parse_xml(xml):
|
||||
"""Parse a GLAPI XML file for ABI entries."""
|
||||
import os
|
||||
GLAPI = "./%s/../glapi/gen" % (os.path.dirname(sys.argv[0]))
|
||||
sys.path.append(GLAPI)
|
||||
import gl_XML, glX_XML
|
||||
|
||||
api = gl_XML.parse_GL_API(xml, glX_XML.glx_item_factory())
|
||||
|
||||
entry_dict = {}
|
||||
for func in api.functionIterateByOffset():
|
||||
# make sure func.name appear first
|
||||
entry_points = func.entry_points[:]
|
||||
entry_points.remove(func.name)
|
||||
entry_points.insert(0, func.name)
|
||||
|
||||
for name in entry_points:
|
||||
attrs = {
|
||||
'slot': func.offset,
|
||||
'hidden': not func.is_static_entry_point(name),
|
||||
'alias': None if name == func.name else func.name,
|
||||
'handcode': bool(func.has_different_protocol(name)),
|
||||
}
|
||||
|
||||
# post-process attrs
|
||||
if attrs['alias']:
|
||||
try:
|
||||
alias = entry_dict[attrs['alias']]
|
||||
except KeyError:
|
||||
raise Exception('failed to alias %s' % attrs['alias'])
|
||||
if alias.alias:
|
||||
raise Exception('recursive alias %s' % ent.name)
|
||||
attrs['alias'] = alias
|
||||
if attrs['handcode']:
|
||||
attrs['handcode'] = func.static_glx_name(name)
|
||||
else:
|
||||
attrs['handcode'] = None
|
||||
|
||||
if entry_dict.has_key(name):
|
||||
raise Exception('%s is duplicated' % (name))
|
||||
|
||||
cols = []
|
||||
cols.append(func.return_type)
|
||||
cols.append(name)
|
||||
params = func.get_parameter_string(name)
|
||||
cols.extend([p.strip() for p in params.split(',')])
|
||||
|
||||
ent = ABIEntry(cols, attrs)
|
||||
entry_dict[ent.name] = ent
|
||||
|
||||
entries = entry_dict.values()
|
||||
entries.sort()
|
||||
|
||||
return entries
|
||||
|
||||
def abi_parse_line(line):
|
||||
cols = [col.strip() for col in line.split(',')]
|
||||
|
||||
@@ -194,9 +249,16 @@ def abi_parse(filename):
|
||||
entries = entry_dict.values()
|
||||
entries.sort()
|
||||
|
||||
# sanity check
|
||||
return entries
|
||||
|
||||
def abi_sanity_check(entries):
|
||||
if not entries:
|
||||
return
|
||||
|
||||
all_names = []
|
||||
last_slot = entries[-1].slot
|
||||
i = 0
|
||||
for slot in xrange(next_slot):
|
||||
for slot in xrange(last_slot + 1):
|
||||
if entries[i].slot != slot:
|
||||
raise Exception('entries are not ordered by slots')
|
||||
if entries[i].alias:
|
||||
@@ -210,12 +272,16 @@ def abi_parse(filename):
|
||||
elif ent.handcode != handcode:
|
||||
raise Exception('two aliases with handcode %s != %s',
|
||||
ent.handcode, handcode)
|
||||
|
||||
if ent.name in all_names:
|
||||
raise Exception('%s is duplicated' % (ent.name))
|
||||
if ent.alias and ent.alias.name not in all_names:
|
||||
raise Exception('failed to alias %s' % (ent.alias.name))
|
||||
all_names.append(ent.name)
|
||||
i += 1
|
||||
if i < len(entries):
|
||||
raise Exception('there are %d invalid entries' % (len(entries) - 1))
|
||||
|
||||
return entries
|
||||
|
||||
class ABIPrinter(object):
|
||||
"""MAPI Printer"""
|
||||
|
||||
@@ -229,6 +295,7 @@ class ABIPrinter(object):
|
||||
self.indent = ' ' * 3
|
||||
self.noop_warn = 'noop_warn'
|
||||
self.noop_generic = 'noop_generic'
|
||||
self.current_get = 'entry_current_get'
|
||||
|
||||
self.api_defines = []
|
||||
self.api_headers = ['"KHR/khrplatform.h"']
|
||||
@@ -236,10 +303,13 @@ class ABIPrinter(object):
|
||||
self.api_entry = 'KHRONOS_APIENTRY'
|
||||
self.api_attrs = 'KHRONOS_APIATTRIBUTES'
|
||||
|
||||
self.c_header = ''
|
||||
|
||||
self.lib_need_table_size = True
|
||||
self.lib_need_noop_array = True
|
||||
self.lib_need_stubs = True
|
||||
self.lib_need_entries = True
|
||||
self.lib_need_all_entries = True
|
||||
self.lib_need_non_hidden_entries = False
|
||||
|
||||
def c_notice(self):
|
||||
return '/* This file is automatically generated by mapi_abi.py. Do not modify. */'
|
||||
@@ -269,11 +339,7 @@ class ABIPrinter(object):
|
||||
|
||||
def c_mapi_table(self):
|
||||
"""Return defines of the dispatch table size."""
|
||||
num_static_entries = 0
|
||||
for ent in self.entries:
|
||||
if not ent.alias:
|
||||
num_static_entries += 1
|
||||
|
||||
num_static_entries = self.entries[-1].slot + 1
|
||||
return ('#define MAPI_TABLE_NUM_STATIC %d\n' + \
|
||||
'#define MAPI_TABLE_NUM_DYNAMIC %d') % (
|
||||
num_static_entries, ABI_NUM_DYNAMIC_ENTRIES)
|
||||
@@ -302,8 +368,11 @@ class ABIPrinter(object):
|
||||
|
||||
def _c_function(self, ent, prefix, mangle=False, stringify=False):
|
||||
"""Return the function name of an entry."""
|
||||
formats = { True: '"%s%s"', False: '%s%s' }
|
||||
fmt = formats[stringify]
|
||||
formats = {
|
||||
True: { True: '%s_STR(%s)', False: '%s(%s)' },
|
||||
False: { True: '"%s%s"', False: '%s%s' },
|
||||
}
|
||||
fmt = formats[prefix.isupper()][stringify]
|
||||
name = ent.name
|
||||
if mangle and ent.hidden:
|
||||
name = '_dispatch_stub_' + str(ent.slot)
|
||||
@@ -313,7 +382,8 @@ class ABIPrinter(object):
|
||||
"""Return the function name used for calling."""
|
||||
if ent.handcode:
|
||||
# _c_function does not handle this case
|
||||
fmt = '%s%s'
|
||||
formats = { True: '%s(%s)', False: '%s%s' }
|
||||
fmt = formats[prefix.isupper()]
|
||||
name = fmt % (prefix, ent.handcode)
|
||||
elif self.need_entry_point(ent):
|
||||
name = self._c_function(ent, prefix, True)
|
||||
@@ -346,10 +416,13 @@ class ABIPrinter(object):
|
||||
|
||||
return "\n".join(decls)
|
||||
|
||||
def c_public_dispatches(self, prefix):
|
||||
def c_public_dispatches(self, prefix, no_hidden):
|
||||
"""Return the public dispatch functions."""
|
||||
dispatches = []
|
||||
for ent in self.entries:
|
||||
if ent.hidden and no_hidden:
|
||||
continue
|
||||
|
||||
if not self.need_entry_point(ent):
|
||||
continue
|
||||
|
||||
@@ -362,12 +435,13 @@ class ABIPrinter(object):
|
||||
if ent.ret:
|
||||
ret = 'return '
|
||||
stmt1 = self.indent
|
||||
stmt1 += 'const struct mapi_table *tbl = u_current_get();'
|
||||
stmt1 += 'const struct mapi_table *_tbl = %s();' % (
|
||||
self.current_get)
|
||||
stmt2 = self.indent
|
||||
stmt2 += 'mapi_func func = ((const mapi_func *) tbl)[%d];' % (
|
||||
stmt2 += 'mapi_func _func = ((const mapi_func *) _tbl)[%d];' % (
|
||||
ent.slot)
|
||||
stmt3 = self.indent
|
||||
stmt3 += '%s((%s) func)(%s);' % (ret, cast, ent.c_args())
|
||||
stmt3 += '%s((%s) _func)(%s);' % (ret, cast, ent.c_args())
|
||||
|
||||
disp = '%s\n{\n%s\n%s\n%s\n}' % (proto, stmt1, stmt2, stmt3)
|
||||
|
||||
@@ -452,11 +526,13 @@ class ABIPrinter(object):
|
||||
pre = self.indent + '(mapi_func) '
|
||||
return pre + (',\n' + pre).join(entries)
|
||||
|
||||
def c_asm_gcc(self, prefix):
|
||||
def c_asm_gcc(self, prefix, no_hidden):
|
||||
asm = []
|
||||
|
||||
asm.append('__asm__(')
|
||||
for ent in self.entries:
|
||||
if ent.hidden and no_hidden:
|
||||
continue
|
||||
|
||||
if not self.need_entry_point(ent):
|
||||
continue
|
||||
|
||||
@@ -468,7 +544,7 @@ class ABIPrinter(object):
|
||||
if ent.hidden:
|
||||
asm.append('".hidden "%s"\\n"' % (name))
|
||||
|
||||
if ent.alias:
|
||||
if ent.alias and not (ent.alias.hidden and no_hidden):
|
||||
asm.append('".globl "%s"\\n"' % (name))
|
||||
asm.append('".set "%s", "%s"\\n"' % (name,
|
||||
self._c_function(ent.alias, prefix, True, True)))
|
||||
@@ -479,12 +555,16 @@ class ABIPrinter(object):
|
||||
if ent.handcode:
|
||||
asm.append('#endif')
|
||||
asm.append('')
|
||||
asm.append(');')
|
||||
|
||||
return "\n".join(asm)
|
||||
|
||||
def output_for_lib(self):
|
||||
print self.c_notice()
|
||||
|
||||
if self.c_header:
|
||||
print
|
||||
print self.c_header
|
||||
|
||||
print
|
||||
print '#ifdef MAPI_TMP_DEFINES'
|
||||
print self.c_public_includes()
|
||||
@@ -505,7 +585,7 @@ class ABIPrinter(object):
|
||||
print '#ifdef MAPI_TMP_NOOP_ARRAY'
|
||||
print '#ifdef DEBUG'
|
||||
print
|
||||
print self.c_noop_functions(self.prefix_noop, self.prefix_lib)
|
||||
print self.c_noop_functions(self.prefix_noop, self.prefix_warn)
|
||||
print
|
||||
print 'const mapi_func table_%s_array[] = {' % (self.prefix_noop)
|
||||
print self.c_noop_initializer(self.prefix_noop, False)
|
||||
@@ -534,10 +614,10 @@ class ABIPrinter(object):
|
||||
print '#undef MAPI_TMP_PUBLIC_STUBS'
|
||||
print '#endif /* MAPI_TMP_PUBLIC_STUBS */'
|
||||
|
||||
if self.lib_need_entries:
|
||||
if self.lib_need_all_entries:
|
||||
print
|
||||
print '#ifdef MAPI_TMP_PUBLIC_ENTRIES'
|
||||
print self.c_public_dispatches(self.prefix_lib)
|
||||
print self.c_public_dispatches(self.prefix_lib, False)
|
||||
print
|
||||
print 'static const mapi_func public_entries[] = {'
|
||||
print self.c_public_initializer(self.prefix_lib)
|
||||
@@ -547,10 +627,35 @@ class ABIPrinter(object):
|
||||
|
||||
print
|
||||
print '#ifdef MAPI_TMP_STUB_ASM_GCC'
|
||||
print self.c_asm_gcc(self.prefix_lib)
|
||||
print '__asm__('
|
||||
print self.c_asm_gcc(self.prefix_lib, False)
|
||||
print ');'
|
||||
print '#undef MAPI_TMP_STUB_ASM_GCC'
|
||||
print '#endif /* MAPI_TMP_STUB_ASM_GCC */'
|
||||
|
||||
if self.lib_need_non_hidden_entries:
|
||||
all_hidden = True
|
||||
for ent in self.entries:
|
||||
if not ent.hidden:
|
||||
all_hidden = False
|
||||
break
|
||||
if not all_hidden:
|
||||
print
|
||||
print '#ifdef MAPI_TMP_PUBLIC_ENTRIES_NO_HIDDEN'
|
||||
print self.c_public_dispatches(self.prefix_lib, True)
|
||||
print
|
||||
print '/* does not need public_entries */'
|
||||
print '#undef MAPI_TMP_PUBLIC_ENTRIES_NO_HIDDEN'
|
||||
print '#endif /* MAPI_TMP_PUBLIC_ENTRIES_NO_HIDDEN */'
|
||||
|
||||
print
|
||||
print '#ifdef MAPI_TMP_STUB_ASM_GCC_NO_HIDDEN'
|
||||
print '__asm__('
|
||||
print self.c_asm_gcc(self.prefix_lib, True)
|
||||
print ');'
|
||||
print '#undef MAPI_TMP_STUB_ASM_GCC_NO_HIDDEN'
|
||||
print '#endif /* MAPI_TMP_STUB_ASM_GCC_NO_HIDDEN */'
|
||||
|
||||
def output_for_app(self):
|
||||
print self.c_notice()
|
||||
print
|
||||
@@ -570,8 +675,9 @@ class ABIPrinter(object):
|
||||
class GLAPIPrinter(ABIPrinter):
|
||||
"""OpenGL API Printer"""
|
||||
|
||||
def __init__(self, entries):
|
||||
super(GLAPIPrinter, self).__init__(entries)
|
||||
def __init__(self, entries, api=None):
|
||||
api_entries = self._get_api_entries(entries, api)
|
||||
super(GLAPIPrinter, self).__init__(api_entries)
|
||||
|
||||
self.api_defines = ['GL_GLEXT_PROTOTYPES']
|
||||
self.api_headers = ['"GL/gl.h"', '"GL/glext.h"']
|
||||
@@ -579,33 +685,539 @@ class GLAPIPrinter(ABIPrinter):
|
||||
self.api_entry = 'APIENTRY'
|
||||
self.api_attrs = ''
|
||||
|
||||
self.prefix_lib = 'gl'
|
||||
self.lib_need_table_size = False
|
||||
self.lib_need_noop_array = False
|
||||
self.lib_need_stubs = False
|
||||
self.lib_need_all_entries = False
|
||||
self.lib_need_non_hidden_entries = True
|
||||
|
||||
self.prefix_lib = 'GLAPI_PREFIX'
|
||||
self.prefix_app = '_mesa_'
|
||||
self.prefix_noop = 'noop'
|
||||
self.prefix_warn = self.prefix_lib
|
||||
|
||||
def output_for_app(self):
|
||||
# not used
|
||||
pass
|
||||
self.c_header = self._get_c_header()
|
||||
|
||||
def _get_api_entries(self, entries, api):
|
||||
"""Override the entry attributes according to API."""
|
||||
import copy
|
||||
|
||||
# no override
|
||||
if api is None:
|
||||
return entries
|
||||
|
||||
api_entries = {}
|
||||
for ent in entries:
|
||||
ent = copy.copy(ent)
|
||||
|
||||
# override 'hidden' and 'handcode'
|
||||
ent.hidden = ent.name not in api
|
||||
ent.handcode = False
|
||||
if ent.alias:
|
||||
ent.alias = api_entries[ent.alias.name]
|
||||
|
||||
api_entries[ent.name] = ent
|
||||
|
||||
# sanity check
|
||||
missed = [name for name in api if name not in api_entries]
|
||||
if missed:
|
||||
raise Exception('%s is missing' % str(missed))
|
||||
|
||||
entries = api_entries.values()
|
||||
entries.sort()
|
||||
|
||||
return entries
|
||||
|
||||
def _get_c_header(self):
|
||||
header = """#ifndef _GLAPI_TMP_H_
|
||||
#define _GLAPI_TMP_H_
|
||||
#ifdef USE_MGL_NAMESPACE
|
||||
#define GLAPI_PREFIX(func) mgl##func
|
||||
#define GLAPI_PREFIX_STR(func) "mgl"#func
|
||||
#else
|
||||
#define GLAPI_PREFIX(func) gl##func
|
||||
#define GLAPI_PREFIX_STR(func) "gl"#func
|
||||
#endif /* USE_MGL_NAMESPACE */
|
||||
|
||||
typedef int GLfixed;
|
||||
typedef int GLclampx;
|
||||
#endif /* _GLAPI_TMP_H_ */"""
|
||||
|
||||
return header
|
||||
|
||||
class ES1APIPrinter(GLAPIPrinter):
|
||||
"""OpenGL ES 1.x API Printer"""
|
||||
|
||||
def __init__(self, entries):
|
||||
super(ES1APIPrinter, self).__init__(entries)
|
||||
es1_api = [
|
||||
# OpenGL ES 1.1
|
||||
'ActiveTexture',
|
||||
'AlphaFunc',
|
||||
'AlphaFuncx',
|
||||
'BindBuffer',
|
||||
'BindTexture',
|
||||
'BlendFunc',
|
||||
'BufferData',
|
||||
'BufferSubData',
|
||||
'Clear',
|
||||
'ClearColor',
|
||||
'ClearColorx',
|
||||
'ClearDepthf',
|
||||
'ClearDepthx',
|
||||
'ClearStencil',
|
||||
'ClientActiveTexture',
|
||||
'ClipPlanef',
|
||||
'ClipPlanex',
|
||||
'Color4f',
|
||||
'Color4ub',
|
||||
'Color4x',
|
||||
'ColorMask',
|
||||
'ColorPointer',
|
||||
'CompressedTexImage2D',
|
||||
'CompressedTexSubImage2D',
|
||||
'CopyTexImage2D',
|
||||
'CopyTexSubImage2D',
|
||||
'CullFace',
|
||||
'DeleteBuffers',
|
||||
'DeleteTextures',
|
||||
'DepthFunc',
|
||||
'DepthMask',
|
||||
'DepthRangef',
|
||||
'DepthRangex',
|
||||
'Disable',
|
||||
'DisableClientState',
|
||||
'DrawArrays',
|
||||
'DrawElements',
|
||||
'Enable',
|
||||
'EnableClientState',
|
||||
'Finish',
|
||||
'Flush',
|
||||
'Fogf',
|
||||
'Fogfv',
|
||||
'Fogx',
|
||||
'Fogxv',
|
||||
'FrontFace',
|
||||
'Frustumf',
|
||||
'Frustumx',
|
||||
'GenBuffers',
|
||||
'GenTextures',
|
||||
'GetBooleanv',
|
||||
'GetBufferParameteriv',
|
||||
'GetClipPlanef',
|
||||
'GetClipPlanex',
|
||||
'GetError',
|
||||
'GetFixedv',
|
||||
'GetFloatv',
|
||||
'GetIntegerv',
|
||||
'GetLightfv',
|
||||
'GetLightxv',
|
||||
'GetMaterialfv',
|
||||
'GetMaterialxv',
|
||||
'GetPointerv',
|
||||
'GetString',
|
||||
'GetTexEnvfv',
|
||||
'GetTexEnviv',
|
||||
'GetTexEnvxv',
|
||||
'GetTexParameterfv',
|
||||
'GetTexParameteriv',
|
||||
'GetTexParameterxv',
|
||||
'Hint',
|
||||
'IsBuffer',
|
||||
'IsEnabled',
|
||||
'IsTexture',
|
||||
'Lightf',
|
||||
'Lightfv',
|
||||
'LightModelf',
|
||||
'LightModelfv',
|
||||
'LightModelx',
|
||||
'LightModelxv',
|
||||
'Lightx',
|
||||
'Lightxv',
|
||||
'LineWidth',
|
||||
'LineWidthx',
|
||||
'LoadIdentity',
|
||||
'LoadMatrixf',
|
||||
'LoadMatrixx',
|
||||
'LogicOp',
|
||||
'Materialf',
|
||||
'Materialfv',
|
||||
'Materialx',
|
||||
'Materialxv',
|
||||
'MatrixMode',
|
||||
'MultiTexCoord4f',
|
||||
'MultiTexCoord4x',
|
||||
'MultMatrixf',
|
||||
'MultMatrixx',
|
||||
'Normal3f',
|
||||
'Normal3x',
|
||||
'NormalPointer',
|
||||
'Orthof',
|
||||
'Orthox',
|
||||
'PixelStorei',
|
||||
'PointParameterf',
|
||||
'PointParameterfv',
|
||||
'PointParameterx',
|
||||
'PointParameterxv',
|
||||
'PointSize',
|
||||
'PointSizex',
|
||||
'PolygonOffset',
|
||||
'PolygonOffsetx',
|
||||
'PopMatrix',
|
||||
'PushMatrix',
|
||||
'ReadPixels',
|
||||
'Rotatef',
|
||||
'Rotatex',
|
||||
'SampleCoverage',
|
||||
'SampleCoveragex',
|
||||
'Scalef',
|
||||
'Scalex',
|
||||
'Scissor',
|
||||
'ShadeModel',
|
||||
'StencilFunc',
|
||||
'StencilMask',
|
||||
'StencilOp',
|
||||
'TexCoordPointer',
|
||||
'TexEnvf',
|
||||
'TexEnvfv',
|
||||
'TexEnvi',
|
||||
'TexEnviv',
|
||||
'TexEnvx',
|
||||
'TexEnvxv',
|
||||
'TexImage2D',
|
||||
'TexParameterf',
|
||||
'TexParameterfv',
|
||||
'TexParameteri',
|
||||
'TexParameteriv',
|
||||
'TexParameterx',
|
||||
'TexParameterxv',
|
||||
'TexSubImage2D',
|
||||
'Translatef',
|
||||
'Translatex',
|
||||
'VertexPointer',
|
||||
'Viewport',
|
||||
# GL_OES_EGL_image
|
||||
'EGLImageTargetTexture2DOES',
|
||||
'EGLImageTargetRenderbufferStorageOES',
|
||||
# GL_OES_mapbuffer
|
||||
'GetBufferPointervOES',
|
||||
'MapBufferOES',
|
||||
'UnmapBufferOES',
|
||||
# GL_EXT_multi_draw_arrays
|
||||
'MultiDrawArraysEXT',
|
||||
'MultiDrawElementsEXT',
|
||||
# GL_OES_blend_equation_separate
|
||||
'BlendEquationSeparateOES',
|
||||
# GL_OES_blend_func_separate
|
||||
'BlendFuncSeparateOES',
|
||||
# GL_OES_blend_subtract
|
||||
'BlendEquationOES',
|
||||
# GL_OES_draw_texture
|
||||
'DrawTexiOES',
|
||||
'DrawTexivOES',
|
||||
'DrawTexfOES',
|
||||
'DrawTexfvOES',
|
||||
'DrawTexsOES',
|
||||
'DrawTexsvOES',
|
||||
'DrawTexxOES',
|
||||
'DrawTexxvOES',
|
||||
# GL_OES_fixed_point
|
||||
'AlphaFuncxOES',
|
||||
'ClearColorxOES',
|
||||
'ClearDepthxOES',
|
||||
'Color4xOES',
|
||||
'DepthRangexOES',
|
||||
'FogxOES',
|
||||
'FogxvOES',
|
||||
'FrustumxOES',
|
||||
'LightModelxOES',
|
||||
'LightModelxvOES',
|
||||
'LightxOES',
|
||||
'LightxvOES',
|
||||
'LineWidthxOES',
|
||||
'LoadMatrixxOES',
|
||||
'MaterialxOES',
|
||||
'MaterialxvOES',
|
||||
'MultiTexCoord4xOES',
|
||||
'MultMatrixxOES',
|
||||
'Normal3xOES',
|
||||
'OrthoxOES',
|
||||
'PointSizexOES',
|
||||
'PolygonOffsetxOES',
|
||||
'RotatexOES',
|
||||
'SampleCoveragexOES',
|
||||
'ScalexOES',
|
||||
'TexEnvxOES',
|
||||
'TexEnvxvOES',
|
||||
'TexParameterxOES',
|
||||
'TranslatexOES',
|
||||
'ClipPlanexOES',
|
||||
'GetClipPlanexOES',
|
||||
'GetFixedvOES',
|
||||
'GetLightxvOES',
|
||||
'GetMaterialxvOES',
|
||||
'GetTexEnvxvOES',
|
||||
'GetTexParameterxvOES',
|
||||
'PointParameterxOES',
|
||||
'PointParameterxvOES',
|
||||
'TexParameterxvOES',
|
||||
# GL_OES_framebuffer_object
|
||||
'BindFramebufferOES',
|
||||
'BindRenderbufferOES',
|
||||
'CheckFramebufferStatusOES',
|
||||
'DeleteFramebuffersOES',
|
||||
'DeleteRenderbuffersOES',
|
||||
'FramebufferRenderbufferOES',
|
||||
'FramebufferTexture2DOES',
|
||||
'GenerateMipmapOES',
|
||||
'GenFramebuffersOES',
|
||||
'GenRenderbuffersOES',
|
||||
'GetFramebufferAttachmentParameterivOES',
|
||||
'GetRenderbufferParameterivOES',
|
||||
'IsFramebufferOES',
|
||||
'IsRenderbufferOES',
|
||||
'RenderbufferStorageOES',
|
||||
# GL_OES_point_size_array
|
||||
'PointSizePointerOES',
|
||||
# GL_OES_query_matrix
|
||||
'QueryMatrixxOES',
|
||||
# GL_OES_single_precision
|
||||
'ClearDepthfOES',
|
||||
'DepthRangefOES',
|
||||
'FrustumfOES',
|
||||
'OrthofOES',
|
||||
'ClipPlanefOES',
|
||||
'GetClipPlanefOES',
|
||||
# GL_OES_texture_cube_map
|
||||
'GetTexGenfvOES',
|
||||
'GetTexGenivOES',
|
||||
'GetTexGenxvOES',
|
||||
'TexGenfOES',
|
||||
'TexGenfvOES',
|
||||
'TexGeniOES',
|
||||
'TexGenivOES',
|
||||
'TexGenxOES',
|
||||
'TexGenxvOES',
|
||||
]
|
||||
|
||||
self.api_headers = ['"GLES/gl.h"', '"GLES/glext.h"']
|
||||
self.api_call = 'GL_API'
|
||||
self.api_entry = 'GL_APIENTRY'
|
||||
super(ES1APIPrinter, self).__init__(entries, es1_api)
|
||||
self.prefix_lib = 'gl'
|
||||
self.prefix_warn = 'gl'
|
||||
|
||||
def _get_c_header(self):
|
||||
header = """#ifndef _GLAPI_TMP_H_
|
||||
#define _GLAPI_TMP_H_
|
||||
typedef int GLfixed;
|
||||
typedef int GLclampx;
|
||||
#endif /* _GLAPI_TMP_H_ */"""
|
||||
|
||||
return header
|
||||
|
||||
class ES2APIPrinter(GLAPIPrinter):
|
||||
"""OpenGL ES 2.x API Printer"""
|
||||
|
||||
def __init__(self, entries):
|
||||
super(ES2APIPrinter, self).__init__(entries)
|
||||
es2_api = [
|
||||
# OpenGL ES 2.0
|
||||
"ActiveTexture",
|
||||
"AttachShader",
|
||||
"BindAttribLocation",
|
||||
"BindBuffer",
|
||||
"BindFramebuffer",
|
||||
"BindRenderbuffer",
|
||||
"BindTexture",
|
||||
"BlendColor",
|
||||
"BlendEquation",
|
||||
"BlendEquationSeparate",
|
||||
"BlendFunc",
|
||||
"BlendFuncSeparate",
|
||||
"BufferData",
|
||||
"BufferSubData",
|
||||
"CheckFramebufferStatus",
|
||||
"Clear",
|
||||
"ClearColor",
|
||||
"ClearDepthf",
|
||||
"ClearStencil",
|
||||
"ColorMask",
|
||||
"CompileShader",
|
||||
"CompressedTexImage2D",
|
||||
"CompressedTexSubImage2D",
|
||||
"CopyTexImage2D",
|
||||
"CopyTexSubImage2D",
|
||||
"CreateProgram",
|
||||
"CreateShader",
|
||||
"CullFace",
|
||||
"DeleteBuffers",
|
||||
"DeleteFramebuffers",
|
||||
"DeleteProgram",
|
||||
"DeleteRenderbuffers",
|
||||
"DeleteShader",
|
||||
"DeleteTextures",
|
||||
"DepthFunc",
|
||||
"DepthMask",
|
||||
"DepthRangef",
|
||||
"DetachShader",
|
||||
"Disable",
|
||||
"DisableVertexAttribArray",
|
||||
"DrawArrays",
|
||||
"DrawElements",
|
||||
"Enable",
|
||||
"EnableVertexAttribArray",
|
||||
"Finish",
|
||||
"Flush",
|
||||
"FramebufferRenderbuffer",
|
||||
"FramebufferTexture2D",
|
||||
"FrontFace",
|
||||
"GenBuffers",
|
||||
"GenerateMipmap",
|
||||
"GenFramebuffers",
|
||||
"GenRenderbuffers",
|
||||
"GenTextures",
|
||||
"GetActiveAttrib",
|
||||
"GetActiveUniform",
|
||||
"GetAttachedShaders",
|
||||
"GetAttribLocation",
|
||||
"GetBooleanv",
|
||||
"GetBufferParameteriv",
|
||||
"GetError",
|
||||
"GetFloatv",
|
||||
"GetFramebufferAttachmentParameteriv",
|
||||
"GetIntegerv",
|
||||
"GetProgramInfoLog",
|
||||
"GetProgramiv",
|
||||
"GetRenderbufferParameteriv",
|
||||
"GetShaderInfoLog",
|
||||
"GetShaderiv",
|
||||
"GetShaderPrecisionFormat",
|
||||
"GetShaderSource",
|
||||
"GetString",
|
||||
"GetTexParameterfv",
|
||||
"GetTexParameteriv",
|
||||
"GetUniformfv",
|
||||
"GetUniformiv",
|
||||
"GetUniformLocation",
|
||||
"GetVertexAttribfv",
|
||||
"GetVertexAttribiv",
|
||||
"GetVertexAttribPointerv",
|
||||
"Hint",
|
||||
"IsBuffer",
|
||||
"IsEnabled",
|
||||
"IsFramebuffer",
|
||||
"IsProgram",
|
||||
"IsRenderbuffer",
|
||||
"IsShader",
|
||||
"IsTexture",
|
||||
"LineWidth",
|
||||
"LinkProgram",
|
||||
"PixelStorei",
|
||||
"PolygonOffset",
|
||||
"ReadPixels",
|
||||
"ReleaseShaderCompiler",
|
||||
"RenderbufferStorage",
|
||||
"SampleCoverage",
|
||||
"Scissor",
|
||||
"ShaderBinary",
|
||||
"ShaderSource",
|
||||
"StencilFunc",
|
||||
"StencilFuncSeparate",
|
||||
"StencilMask",
|
||||
"StencilMaskSeparate",
|
||||
"StencilOp",
|
||||
"StencilOpSeparate",
|
||||
"TexImage2D",
|
||||
"TexParameterf",
|
||||
"TexParameterfv",
|
||||
"TexParameteri",
|
||||
"TexParameteriv",
|
||||
"TexSubImage2D",
|
||||
"Uniform1f",
|
||||
"Uniform1fv",
|
||||
"Uniform1i",
|
||||
"Uniform1iv",
|
||||
"Uniform2f",
|
||||
"Uniform2fv",
|
||||
"Uniform2i",
|
||||
"Uniform2iv",
|
||||
"Uniform3f",
|
||||
"Uniform3fv",
|
||||
"Uniform3i",
|
||||
"Uniform3iv",
|
||||
"Uniform4f",
|
||||
"Uniform4fv",
|
||||
"Uniform4i",
|
||||
"Uniform4iv",
|
||||
"UniformMatrix2fv",
|
||||
"UniformMatrix3fv",
|
||||
"UniformMatrix4fv",
|
||||
"UseProgram",
|
||||
"ValidateProgram",
|
||||
"VertexAttrib1f",
|
||||
"VertexAttrib1fv",
|
||||
"VertexAttrib2f",
|
||||
"VertexAttrib2fv",
|
||||
"VertexAttrib3f",
|
||||
"VertexAttrib3fv",
|
||||
"VertexAttrib4f",
|
||||
"VertexAttrib4fv",
|
||||
"VertexAttribPointer",
|
||||
"Viewport",
|
||||
# GL_OES_EGL_image
|
||||
'EGLImageTargetTexture2DOES',
|
||||
'EGLImageTargetRenderbufferStorageOES',
|
||||
# GL_OES_mapbuffer
|
||||
'GetBufferPointervOES',
|
||||
'MapBufferOES',
|
||||
'UnmapBufferOES',
|
||||
# GL_EXT_multi_draw_arrays
|
||||
'MultiDrawArraysEXT',
|
||||
'MultiDrawElementsEXT',
|
||||
# GL_OES_texture_3D
|
||||
'CompressedTexImage3DOES',
|
||||
'CompressedTexSubImage3DOES',
|
||||
'CopyTexSubImage3DOES',
|
||||
'FramebufferTexture3DOES',
|
||||
'TexImage3DOES',
|
||||
'TexSubImage3DOES',
|
||||
# GL_OES_get_program_binary
|
||||
'GetProgramBinaryOES',
|
||||
'ProgramBinaryOES',
|
||||
]
|
||||
|
||||
self.api_headers = ['"GLES2/gl2.h"', '"GLES2/gl2ext.h"']
|
||||
self.api_call = 'GL_APICALL'
|
||||
self.api_entry = 'GL_APIENTRY'
|
||||
super(ES2APIPrinter, self).__init__(entries, es2_api)
|
||||
self.prefix_lib = 'gl'
|
||||
self.prefix_warn = 'gl'
|
||||
|
||||
def _get_c_header(self):
|
||||
header = """#ifndef _GLAPI_TMP_H_
|
||||
#define _GLAPI_TMP_H_
|
||||
typedef int GLfixed;
|
||||
typedef int GLclampx;
|
||||
#endif /* _GLAPI_TMP_H_ */"""
|
||||
|
||||
return header
|
||||
|
||||
class SharedGLAPIPrinter(GLAPIPrinter):
|
||||
"""Shared GLAPI API Printer"""
|
||||
|
||||
def __init__(self, entries):
|
||||
super(SharedGLAPIPrinter, self).__init__(entries, [])
|
||||
|
||||
self.lib_need_table_size = True
|
||||
self.lib_need_noop_array = True
|
||||
self.lib_need_stubs = True
|
||||
self.lib_need_all_entries = True
|
||||
self.lib_need_non_hidden_entries = False
|
||||
|
||||
self.prefix_lib = 'shared'
|
||||
self.prefix_warn = 'gl'
|
||||
|
||||
def _get_c_header(self):
|
||||
header = """#ifndef _GLAPI_TMP_H_
|
||||
#define _GLAPI_TMP_H_
|
||||
typedef int GLfixed;
|
||||
typedef int GLclampx;
|
||||
#endif /* _GLAPI_TMP_H_ */"""
|
||||
|
||||
return header
|
||||
|
||||
class VGAPIPrinter(ABIPrinter):
|
||||
"""OpenVG API Printer"""
|
||||
@@ -622,9 +1234,10 @@ class VGAPIPrinter(ABIPrinter):
|
||||
self.prefix_lib = 'vg'
|
||||
self.prefix_app = 'vega'
|
||||
self.prefix_noop = 'noop'
|
||||
self.prefix_warn = 'vg'
|
||||
|
||||
def parse_args():
|
||||
printers = ['glapi', 'es1api', 'es2api', 'vgapi']
|
||||
printers = ['vgapi', 'glapi', 'es1api', 'es2api', 'shared-glapi']
|
||||
modes = ['lib', 'app']
|
||||
|
||||
parser = OptionParser(usage='usage: %prog [options] <filename>')
|
||||
@@ -646,12 +1259,18 @@ def main():
|
||||
'vgapi': VGAPIPrinter,
|
||||
'glapi': GLAPIPrinter,
|
||||
'es1api': ES1APIPrinter,
|
||||
'es2api': ES2APIPrinter
|
||||
'es2api': ES2APIPrinter,
|
||||
'shared-glapi': SharedGLAPIPrinter,
|
||||
}
|
||||
|
||||
filename, options = parse_args()
|
||||
|
||||
entries = abi_parse(filename)
|
||||
if filename.endswith('.xml'):
|
||||
entries = abi_parse_xml(filename)
|
||||
else:
|
||||
entries = abi_parse(filename)
|
||||
abi_sanity_check(entries)
|
||||
|
||||
printer = printers[options.printer](entries)
|
||||
if options.mode == 'lib':
|
||||
printer.output_for_lib()
|
||||
|
||||
@@ -0,0 +1,240 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
* Version: 7.9
|
||||
*
|
||||
* Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
|
||||
* Copyright (C) 2010 LunarG Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* Authors:
|
||||
* Chia-I Wu <olv@lunarg.com>
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "glapi/glapi.h"
|
||||
#include "mapi/u_current.h"
|
||||
#include "mapi/table.h" /* for MAPI_TABLE_NUM_SLOTS */
|
||||
#include "mapi/stub.h"
|
||||
|
||||
/*
|
||||
* Global variables, _glapi_get_context, and _glapi_get_dispatch are defined in
|
||||
* u_current.c.
|
||||
*/
|
||||
|
||||
#ifdef GLX_USE_TLS
|
||||
/* not used, but defined for compatibility */
|
||||
const struct _glapi_table *_glapi_Dispatch;
|
||||
const void *_glapi_Context;
|
||||
#endif /* GLX_USE_TLS */
|
||||
|
||||
void
|
||||
_glapi_destroy_multithread(void)
|
||||
{
|
||||
u_current_destroy();
|
||||
}
|
||||
|
||||
void
|
||||
_glapi_check_multithread(void)
|
||||
{
|
||||
u_current_init();
|
||||
}
|
||||
|
||||
void
|
||||
_glapi_set_context(void *context)
|
||||
{
|
||||
u_current_set_user((const void *) context);
|
||||
}
|
||||
|
||||
void
|
||||
_glapi_set_dispatch(struct _glapi_table *dispatch)
|
||||
{
|
||||
u_current_set((const struct mapi_table *) dispatch);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return size of dispatch table struct as number of functions (or
|
||||
* slots).
|
||||
*/
|
||||
unsigned int
|
||||
_glapi_get_dispatch_table_size(void)
|
||||
{
|
||||
return MAPI_TABLE_NUM_SLOTS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fill-in the dispatch stub for the named function.
|
||||
*
|
||||
* This function is intended to be called by a hardware driver. When called,
|
||||
* a dispatch stub may be created created for the function. A pointer to this
|
||||
* dispatch function will be returned by glXGetProcAddress.
|
||||
*
|
||||
* \param function_names Array of pointers to function names that should
|
||||
* share a common dispatch offset.
|
||||
* \param parameter_signature String representing the types of the parameters
|
||||
* passed to the named function. Parameter types
|
||||
* are converted to characters using the following
|
||||
* rules:
|
||||
* - 'i' for \c GLint, \c GLuint, and \c GLenum
|
||||
* - 'p' for any pointer type
|
||||
* - 'f' for \c GLfloat and \c GLclampf
|
||||
* - 'd' for \c GLdouble and \c GLclampd
|
||||
*
|
||||
* \returns
|
||||
* The offset in the dispatch table of the named function. A pointer to the
|
||||
* driver's implementation of the named function should be stored at
|
||||
* \c dispatch_table[\c offset]. Return -1 if error/problem.
|
||||
*
|
||||
* \sa glXGetProcAddress
|
||||
*
|
||||
* \warning
|
||||
* This function can only handle up to 8 names at a time. As far as I know,
|
||||
* the maximum number of names ever associated with an existing GL function is
|
||||
* 4 (\c glPointParameterfSGIS, \c glPointParameterfEXT,
|
||||
* \c glPointParameterfARB, and \c glPointParameterf), so this should not be
|
||||
* too painful of a limitation.
|
||||
*
|
||||
* \todo
|
||||
* Check parameter_signature.
|
||||
*/
|
||||
int
|
||||
_glapi_add_dispatch( const char * const * function_names,
|
||||
const char * parameter_signature )
|
||||
{
|
||||
const struct mapi_stub *function_stubs[8];
|
||||
const struct mapi_stub *alias = NULL;
|
||||
unsigned i;
|
||||
|
||||
(void) memset(function_stubs, 0, sizeof(function_stubs));
|
||||
|
||||
/* find the missing stubs, and decide the alias */
|
||||
for (i = 0; function_names[i] != NULL && i < 8; i++) {
|
||||
const char * funcName = function_names[i];
|
||||
const struct mapi_stub *stub;
|
||||
int slot;
|
||||
|
||||
if (!funcName || funcName[0] != 'g' || funcName[1] != 'l')
|
||||
return -1;
|
||||
funcName += 2;
|
||||
|
||||
stub = stub_find_public(funcName);
|
||||
if (!stub)
|
||||
stub = stub_find_dynamic(funcName, 0);
|
||||
|
||||
slot = (stub) ? stub_get_slot(stub) : -1;
|
||||
if (slot >= 0) {
|
||||
if (alias && stub_get_slot(alias) != slot)
|
||||
return -1;
|
||||
/* use the first existing stub as the alias */
|
||||
if (!alias)
|
||||
alias = stub;
|
||||
|
||||
function_stubs[i] = stub;
|
||||
}
|
||||
}
|
||||
|
||||
/* generate missing stubs */
|
||||
for (i = 0; function_names[i] != NULL && i < 8; i++) {
|
||||
const char * funcName = function_names[i] + 2;
|
||||
struct mapi_stub *stub;
|
||||
|
||||
if (function_stubs[i])
|
||||
continue;
|
||||
|
||||
stub = stub_find_dynamic(funcName, 1);
|
||||
if (!stub)
|
||||
return -1;
|
||||
|
||||
stub_fix_dynamic(stub, alias);
|
||||
if (!alias)
|
||||
alias = stub;
|
||||
}
|
||||
|
||||
return (alias) ? stub_get_slot(alias) : -1;
|
||||
}
|
||||
|
||||
static const struct mapi_stub *
|
||||
_glapi_get_stub(const char *name, int generate)
|
||||
{
|
||||
const struct mapi_stub *stub;
|
||||
|
||||
#ifdef USE_MGL_NAMESPACE
|
||||
if (name)
|
||||
name++;
|
||||
#endif
|
||||
|
||||
if (!name || name[0] != 'g' || name[1] != 'l')
|
||||
return NULL;
|
||||
name += 2;
|
||||
|
||||
stub = stub_find_public(name);
|
||||
if (!stub)
|
||||
stub = stub_find_dynamic(name, generate);
|
||||
|
||||
return stub;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return offset of entrypoint for named function within dispatch table.
|
||||
*/
|
||||
int
|
||||
_glapi_get_proc_offset(const char *funcName)
|
||||
{
|
||||
const struct mapi_stub *stub = _glapi_get_stub(funcName, 0);
|
||||
return (stub) ? stub_get_slot(stub) : -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return pointer to the named function. If the function name isn't found
|
||||
* in the name of static functions, try generating a new API entrypoint on
|
||||
* the fly with assembly language.
|
||||
*/
|
||||
_glapi_proc
|
||||
_glapi_get_proc_address(const char *funcName)
|
||||
{
|
||||
const struct mapi_stub *stub = _glapi_get_stub(funcName, 1);
|
||||
return (stub) ? (_glapi_proc) stub_get_addr(stub) : NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the name of the function at the given dispatch offset.
|
||||
* This is only intended for debugging.
|
||||
*/
|
||||
const char *
|
||||
_glapi_get_proc_name(unsigned int offset)
|
||||
{
|
||||
/* not implemented */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
unsigned long
|
||||
_glthread_GetID(void)
|
||||
{
|
||||
return u_thread_self();
|
||||
}
|
||||
|
||||
void
|
||||
_glapi_noop_enable_warnings(unsigned char enable)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
_glapi_set_warning_func(_glapi_proc func)
|
||||
{
|
||||
}
|
||||
@@ -30,4 +30,19 @@
|
||||
#error "MAPI_ABI_HEADER must be defined"
|
||||
#endif
|
||||
|
||||
/* does not need hidden entries in bridge mode */
|
||||
#ifdef MAPI_MODE_BRIDGE
|
||||
|
||||
#ifdef MAPI_TMP_PUBLIC_ENTRIES
|
||||
#undef MAPI_TMP_PUBLIC_ENTRIES
|
||||
#define MAPI_TMP_PUBLIC_ENTRIES_NO_HIDDEN
|
||||
#endif
|
||||
|
||||
#ifdef MAPI_TMP_STUB_ASM_GCC
|
||||
#undef MAPI_TMP_STUB_ASM_GCC
|
||||
#define MAPI_TMP_STUB_ASM_GCC_NO_HIDDEN
|
||||
#endif
|
||||
|
||||
#endif /* MAPI_MODE_BRIDGE */
|
||||
|
||||
#include MAPI_ABI_HEADER
|
||||
|
||||
@@ -7,6 +7,12 @@
|
||||
#
|
||||
# - In util mode, mapi provides utility functions for use with glapi. To use
|
||||
# this mode, compile MAPI_UTIL_SOURCES with MAPI_MODE_UTIL defined.
|
||||
#
|
||||
# - In glapi mode, mapi implements the interface defined by glapi.h. To use
|
||||
# this mode, compile MAPI_GLAPI_SOURCES with MAPI_MODE_GLAPI defined.
|
||||
#
|
||||
# - In bridge mode, mapi provides entry points calling into glapi. To use
|
||||
# this mode, compile MAPI_BRIDGE_SOURCES with MAPI_MODE_BRIDGE defined.
|
||||
|
||||
MAPI_UTIL_SOURCES = \
|
||||
u_current.c \
|
||||
@@ -19,3 +25,13 @@ MAPI_SOURCES = \
|
||||
stub.c \
|
||||
table.c \
|
||||
$(MAPI_UTIL_SOURCES)
|
||||
|
||||
MAPI_GLAPI_SOURCES = \
|
||||
entry.c \
|
||||
mapi_glapi.c \
|
||||
stub.c \
|
||||
table.c \
|
||||
$(MAPI_UTIL_SOURCES)
|
||||
|
||||
MAPI_BRIDGE_SOURCES = \
|
||||
entry.c
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#ifndef _U_CURRENT_H_
|
||||
#define _U_CURRENT_H_
|
||||
|
||||
#ifdef MAPI_MODE_UTIL
|
||||
#if defined(MAPI_MODE_UTIL) || defined(MAPI_MODE_GLAPI) || \
|
||||
defined(MAPI_MODE_BRIDGE)
|
||||
|
||||
#include "glapi/glapi.h"
|
||||
|
||||
@@ -21,7 +22,7 @@
|
||||
|
||||
#define u_current_table_tsd _gl_DispatchTSD
|
||||
|
||||
#else /* MAPI_MODE_UTIL */
|
||||
#else /* MAPI_MODE_UTIL || MAPI_MODE_GLAPI || MAPI_MODE_BRIDGE */
|
||||
|
||||
#include "u_compiler.h"
|
||||
|
||||
@@ -42,7 +43,7 @@ extern void *u_current_user;
|
||||
|
||||
#endif /* GLX_USE_TLS */
|
||||
|
||||
#endif /* MAPI_MODE_UTIL */
|
||||
#endif /* MAPI_MODE_UTIL || MAPI_MODE_GLAPI || MAPI_MODE_BRIDGE */
|
||||
|
||||
void
|
||||
u_current_init(void);
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
# src/mapi/shared-glapi/Makefile
|
||||
#
|
||||
# Used by OpenGL ES or when --enable-shared-glapi is specified
|
||||
#
|
||||
|
||||
TOP := ../../..
|
||||
include $(TOP)/configs/current
|
||||
|
||||
GLAPI := $(TOP)/src/mapi/glapi
|
||||
MAPI := $(TOP)/src/mapi/mapi
|
||||
|
||||
glapi_CPPFLAGS := \
|
||||
-I$(TOP)/include \
|
||||
-I$(TOP)/src/mapi \
|
||||
-DMAPI_MODE_GLAPI \
|
||||
-DMAPI_ABI_HEADER=\"shared-glapi/glapi_mapi_tmp.h\"
|
||||
|
||||
include $(MAPI)/sources.mak
|
||||
glapi_SOURCES := $(addprefix $(MAPI)/, $(MAPI_GLAPI_SOURCES))
|
||||
glapi_OBJECTS := $(MAPI_GLAPI_SOURCES:.c=.o)
|
||||
|
||||
.PHONY: default
|
||||
default: depend $(TOP)/$(LIB_DIR)/$(GLAPI_LIB_NAME)
|
||||
|
||||
$(TOP)/$(LIB_DIR)/$(GLAPI_LIB_NAME): $(glapi_OBJECTS)
|
||||
$(MKLIB) -o $(GLAPI_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
|
||||
-major 0 -minor 0 -patch 0 \
|
||||
-id $(INSTALL_LIB_DIR)/lib$(GLAPI_LIB).0.dylib \
|
||||
$(MKLIB_OPTIONS) -install $(TOP)/$(LIB_DIR) \
|
||||
$(glapi_OBJECTS) $(GLAPI_LIB_DEPS)
|
||||
|
||||
$(glapi_OBJECTS): %.o: $(MAPI)/%.c
|
||||
$(CC) -c $(glapi_CPPFLAGS) $(CFLAGS) $< -o $@
|
||||
|
||||
$(glapi_SOURCES): glapi_mapi_tmp.h
|
||||
|
||||
.PHONY: glapi_mapi_tmp.h
|
||||
glapi_mapi_tmp.h:
|
||||
@$(MAKE) -C $(GLAPI)/gen-es shared-glapi
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
-rm -f $(TOP)/$(LIB_DIR)/$(GLAPI_LIB_NAME)
|
||||
-rm -f $(glapi_OBJECTS)
|
||||
-rm -f depend depend.bak
|
||||
@# clean generated sources/headers
|
||||
@$(MAKE) -C $(GLAPI)/gen-es clean-shared-glapi
|
||||
|
||||
install:
|
||||
$(INSTALL) -d $(DESTDIR)$(INSTALL_LIB_DIR)
|
||||
$(MINSTALL) $(TOP)/$(LIB_DIR)/$(GLAPI_LIB_GLOB) \
|
||||
$(DESTDIR)$(INSTALL_LIB_DIR)
|
||||
|
||||
depend: $(glapi_SOURCES)
|
||||
@echo "running $(MKDEP)"
|
||||
@touch depend
|
||||
@$(MKDEP) $(MKDEP_OPTIONS) -f- $(DEFINES) $(glapi_CPPFLAGS) \
|
||||
$(glapi_SOURCES) 2>/dev/null | sed -e 's,^$(MAPI)/,,' \
|
||||
> depend
|
||||
|
||||
-include depend
|
||||
@@ -108,6 +108,7 @@ CXX_SOURCES = \
|
||||
brw_fs.cpp \
|
||||
brw_fs_channel_expressions.cpp \
|
||||
brw_fs_reg_allocate.cpp \
|
||||
brw_fs_schedule_instructions.cpp \
|
||||
brw_fs_vector_splitting.cpp
|
||||
|
||||
ASM_SOURCES =
|
||||
|
||||
@@ -316,7 +316,6 @@ int
|
||||
fs_visitor::setup_uniform_values(int loc, const glsl_type *type)
|
||||
{
|
||||
unsigned int offset = 0;
|
||||
float *vec_values;
|
||||
|
||||
if (type->is_matrix()) {
|
||||
const glsl_type *column = glsl_type::get_instance(GLSL_TYPE_FLOAT,
|
||||
@@ -335,7 +334,6 @@ fs_visitor::setup_uniform_values(int loc, const glsl_type *type)
|
||||
case GLSL_TYPE_UINT:
|
||||
case GLSL_TYPE_INT:
|
||||
case GLSL_TYPE_BOOL:
|
||||
vec_values = fp->Base.Parameters->ParameterValues[loc];
|
||||
for (unsigned int i = 0; i < type->vector_elements; i++) {
|
||||
unsigned int param = c->prog_data.nr_params++;
|
||||
|
||||
@@ -359,8 +357,8 @@ fs_visitor::setup_uniform_values(int loc, const glsl_type *type)
|
||||
c->prog_data.param_convert[param] = PARAM_NO_CONVERT;
|
||||
break;
|
||||
}
|
||||
|
||||
c->prog_data.param[param] = &vec_values[i];
|
||||
this->param_index[param] = loc;
|
||||
this->param_offset[param] = i;
|
||||
}
|
||||
return 1;
|
||||
|
||||
@@ -431,7 +429,6 @@ fs_visitor::setup_builtin_uniform_values(ir_variable *ir)
|
||||
*/
|
||||
int index = _mesa_add_state_reference(this->fp->Base.Parameters,
|
||||
(gl_state_index *)tokens);
|
||||
float *vec_values = this->fp->Base.Parameters->ParameterValues[index];
|
||||
|
||||
/* Add each of the unique swizzles of the element as a
|
||||
* parameter. This'll end up matching the expected layout of
|
||||
@@ -446,7 +443,9 @@ fs_visitor::setup_builtin_uniform_values(ir_variable *ir)
|
||||
|
||||
c->prog_data.param_convert[c->prog_data.nr_params] =
|
||||
PARAM_NO_CONVERT;
|
||||
c->prog_data.param[c->prog_data.nr_params++] = &vec_values[swiz];
|
||||
this->param_index[c->prog_data.nr_params] = index;
|
||||
this->param_offset[c->prog_data.nr_params] = swiz;
|
||||
c->prog_data.nr_params++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1370,10 +1369,13 @@ fs_visitor::visit(ir_texture *ir)
|
||||
fs_reg scale_y = fs_reg(UNIFORM, c->prog_data.nr_params + 1);
|
||||
GLuint index = _mesa_add_state_reference(params,
|
||||
(gl_state_index *)tokens);
|
||||
float *vec_values = this->fp->Base.Parameters->ParameterValues[index];
|
||||
|
||||
c->prog_data.param[c->prog_data.nr_params++] = &vec_values[0];
|
||||
c->prog_data.param[c->prog_data.nr_params++] = &vec_values[1];
|
||||
this->param_index[c->prog_data.nr_params] = index;
|
||||
this->param_offset[c->prog_data.nr_params] = 0;
|
||||
c->prog_data.nr_params++;
|
||||
this->param_index[c->prog_data.nr_params] = index;
|
||||
this->param_offset[c->prog_data.nr_params] = 1;
|
||||
c->prog_data.nr_params++;
|
||||
|
||||
fs_reg dst = fs_reg(this, ir->coordinate->type);
|
||||
fs_reg src = coordinate;
|
||||
@@ -2500,6 +2502,22 @@ fs_visitor::generate_pull_constant_load(fs_inst *inst, struct brw_reg dst)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To be called after the last _mesa_add_state_reference() call, to
|
||||
* set up prog_data.param[] for assign_curb_setup() and
|
||||
* setup_pull_constants().
|
||||
*/
|
||||
void
|
||||
fs_visitor::setup_paramvalues_refs()
|
||||
{
|
||||
/* Set up the pointers to ParamValues now that that array is finalized. */
|
||||
for (unsigned int i = 0; i < c->prog_data.nr_params; i++) {
|
||||
c->prog_data.param[i] =
|
||||
fp->Base.Parameters->ParameterValues[this->param_index[i]] +
|
||||
this->param_offset[i];
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
fs_visitor::assign_curb_setup()
|
||||
{
|
||||
@@ -2629,10 +2647,7 @@ fs_visitor::split_virtual_grfs()
|
||||
fs_inst *inst = (fs_inst *)iter.get();
|
||||
|
||||
/* Texturing produces 4 contiguous registers, so no splitting. */
|
||||
if ((inst->opcode == FS_OPCODE_TEX ||
|
||||
inst->opcode == FS_OPCODE_TXB ||
|
||||
inst->opcode == FS_OPCODE_TXL) &&
|
||||
inst->dst.file == GRF) {
|
||||
if (inst->is_tex()) {
|
||||
split_grf[inst->dst.reg] = false;
|
||||
}
|
||||
}
|
||||
@@ -2920,7 +2935,7 @@ fs_visitor::propagate_constants()
|
||||
if (scan_inst->dst.file == GRF &&
|
||||
scan_inst->dst.reg == inst->dst.reg &&
|
||||
(scan_inst->dst.reg_offset == inst->dst.reg_offset ||
|
||||
scan_inst->opcode == FS_OPCODE_TEX)) {
|
||||
scan_inst->is_tex())) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3015,13 +3030,13 @@ fs_visitor::register_coalesce()
|
||||
if (scan_inst->dst.file == GRF) {
|
||||
if (scan_inst->dst.reg == inst->dst.reg &&
|
||||
(scan_inst->dst.reg_offset == inst->dst.reg_offset ||
|
||||
scan_inst->opcode == FS_OPCODE_TEX)) {
|
||||
scan_inst->is_tex())) {
|
||||
interfered = true;
|
||||
break;
|
||||
}
|
||||
if (scan_inst->dst.reg == inst->src[0].reg &&
|
||||
(scan_inst->dst.reg_offset == inst->src[0].reg_offset ||
|
||||
scan_inst->opcode == FS_OPCODE_TEX)) {
|
||||
scan_inst->is_tex())) {
|
||||
interfered = true;
|
||||
break;
|
||||
}
|
||||
@@ -3102,7 +3117,7 @@ fs_visitor::compute_to_mrf()
|
||||
* into a compute-to-MRF.
|
||||
*/
|
||||
|
||||
if (scan_inst->opcode == FS_OPCODE_TEX) {
|
||||
if (scan_inst->is_tex()) {
|
||||
/* texturing writes several continuous regs, so we can't
|
||||
* compute-to-mrf that.
|
||||
*/
|
||||
@@ -3123,14 +3138,7 @@ fs_visitor::compute_to_mrf()
|
||||
/* gen6 math instructions must have the destination be
|
||||
* GRF, so no compute-to-MRF for them.
|
||||
*/
|
||||
if (scan_inst->opcode == FS_OPCODE_RCP ||
|
||||
scan_inst->opcode == FS_OPCODE_RSQ ||
|
||||
scan_inst->opcode == FS_OPCODE_SQRT ||
|
||||
scan_inst->opcode == FS_OPCODE_EXP2 ||
|
||||
scan_inst->opcode == FS_OPCODE_LOG2 ||
|
||||
scan_inst->opcode == FS_OPCODE_SIN ||
|
||||
scan_inst->opcode == FS_OPCODE_COS ||
|
||||
scan_inst->opcode == FS_OPCODE_POW) {
|
||||
if (scan_inst->is_math()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -3152,6 +3160,7 @@ fs_visitor::compute_to_mrf()
|
||||
*/
|
||||
if (scan_inst->opcode == BRW_OPCODE_DO ||
|
||||
scan_inst->opcode == BRW_OPCODE_WHILE ||
|
||||
scan_inst->opcode == BRW_OPCODE_ELSE ||
|
||||
scan_inst->opcode == BRW_OPCODE_ENDIF) {
|
||||
break;
|
||||
}
|
||||
@@ -3238,7 +3247,7 @@ fs_visitor::remove_duplicate_mrf_writes()
|
||||
}
|
||||
|
||||
if (inst->mlen > 0) {
|
||||
/* Found a SEND instruction, which will include two of fewer
|
||||
/* Found a SEND instruction, which will include two or fewer
|
||||
* implied MRF writes. We could do better here.
|
||||
*/
|
||||
for (int i = 0; i < implied_mrf_writes(inst); i++) {
|
||||
@@ -3662,10 +3671,9 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c)
|
||||
v.emit_fb_writes();
|
||||
|
||||
v.split_virtual_grfs();
|
||||
v.setup_pull_constants();
|
||||
|
||||
v.assign_curb_setup();
|
||||
v.assign_urb_setup();
|
||||
v.setup_paramvalues_refs();
|
||||
v.setup_pull_constants();
|
||||
|
||||
bool progress;
|
||||
do {
|
||||
@@ -3679,6 +3687,11 @@ brw_wm_fs_emit(struct brw_context *brw, struct brw_wm_compile *c)
|
||||
progress = v.dead_code_eliminate() || progress;
|
||||
} while (progress);
|
||||
|
||||
v.schedule_instructions();
|
||||
|
||||
v.assign_curb_setup();
|
||||
v.assign_urb_setup();
|
||||
|
||||
if (0) {
|
||||
/* Debug of register spilling: Go spill everything. */
|
||||
int virtual_grf_count = v.virtual_grf_next;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user