Compare commits
97 Commits
mesa-21.3.
...
mesa-9.2-r
Author | SHA1 | Date | |
---|---|---|---|
|
796b4a7b40 | ||
|
d3004acdd1 | ||
|
684316512c | ||
|
9f7f727345 | ||
|
1fb22bf143 | ||
|
9fa7313e34 | ||
|
6296abed15 | ||
|
5b8c943eb2 | ||
|
d72f7720a6 | ||
|
b40d9e4f41 | ||
|
e2185778e2 | ||
|
a98d5f2663 | ||
|
24d1949ddc | ||
|
996bc26c87 | ||
|
b055c8689e | ||
|
d6d0175203 | ||
|
4ba5fd1052 | ||
|
872c09586c | ||
|
4f44202aae | ||
|
33b581f6f6 | ||
|
c088c24588 | ||
|
7d6dcb61cd | ||
|
8025bac852 | ||
|
5d6dc93490 | ||
|
31f582abd4 | ||
|
0b131ae24f | ||
|
8ee4a4e417 | ||
|
0c405cd0e8 | ||
|
b76ff3dbcd | ||
|
cb8e109492 | ||
|
4006fc4656 | ||
|
731a08341e | ||
|
3da0c76ec0 | ||
|
10ff10c89e | ||
|
12da1bcb3b | ||
|
195e995968 | ||
|
6f9b090719 | ||
|
70c9e07bd4 | ||
|
d383ff0843 | ||
|
d1419857d7 | ||
|
c15b2d86e2 | ||
|
1e0ad955e7 | ||
|
9aeb967e75 | ||
|
001c29cb18 | ||
|
c331562158 | ||
|
8e1d37161f | ||
|
78e760c234 | ||
|
71891ce017 | ||
|
a19bc84380 | ||
|
73bde3b8ff | ||
|
4a37827752 | ||
|
adc87c5e3f | ||
|
4d7ebeb51e | ||
|
6d8f471640 | ||
|
687415cf70 | ||
|
e4f81bdbc4 | ||
|
6c25c0a0da | ||
|
526e71bfcc | ||
|
06aee8a56c | ||
|
b319e3975e | ||
|
d4c2c5a739 | ||
|
a3f48d97cd | ||
|
030ada7a50 | ||
|
b61036fa2d | ||
|
ddf6f591a9 | ||
|
e3dbfc5769 | ||
|
cdcba2878a | ||
|
8efee44c38 | ||
|
3bdd95270d | ||
|
5476049e38 | ||
|
a2dbaeb2d8 | ||
|
ded1695494 | ||
|
3213c60d81 | ||
|
678ac190a5 | ||
|
771b576da6 | ||
|
9c66a29358 | ||
|
5154c93fa8 | ||
|
8a27c824ec | ||
|
4953bf3837 | ||
|
c7bfe87721 | ||
|
c6f6b4e161 | ||
|
4f5e18cb3e | ||
|
e108bb07a0 | ||
|
55241e9958 | ||
|
6237090330 | ||
|
55ab069e5f | ||
|
925e8a200b | ||
|
014b9ceb62 | ||
|
8f80e55002 | ||
|
579eae3012 | ||
|
cb06c9b2aa | ||
|
253a4c3e73 | ||
|
99666d81e4 | ||
|
e8bc520713 | ||
|
49f40ebefa | ||
|
9b8ad64362 | ||
|
ee421aec32 |
@@ -35,7 +35,7 @@ LOCAL_C_INCLUDES += \
|
||||
|
||||
# define ANDROID_VERSION (e.g., 4.0.x => 0x0400)
|
||||
LOCAL_CFLAGS += \
|
||||
-DPACKAGE_VERSION=\"9.2.0-devel\" \
|
||||
-DPACKAGE_VERSION=\"9.2.0-rc1\" \
|
||||
-DPACKAGE_BUGREPORT=\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\" \
|
||||
-DANDROID_VERSION=0x0$(MESA_ANDROID_MAJOR_VERSION)0$(MESA_ANDROID_MINOR_VERSION)
|
||||
|
||||
|
@@ -57,12 +57,6 @@ EXTRA_FILES = \
|
||||
src/glsl/glcpp/glcpp-lex.c \
|
||||
src/glsl/glcpp/glcpp-parse.c \
|
||||
src/glsl/glcpp/glcpp-parse.h \
|
||||
src/mesa/main/api_exec_es1.c \
|
||||
src/mesa/main/api_exec_es1_dispatch.h \
|
||||
src/mesa/main/api_exec_es1_remap_helper.h \
|
||||
src/mesa/main/api_exec_es2.c \
|
||||
src/mesa/main/api_exec_es2_dispatch.h \
|
||||
src/mesa/main/api_exec_es2_remap_helper.h \
|
||||
src/mesa/program/lex.yy.c \
|
||||
src/mesa/program/program_parse.tab.c \
|
||||
src/mesa/program/program_parse.tab.h \
|
||||
|
@@ -70,7 +70,7 @@ if env['gles']:
|
||||
# Environment setup
|
||||
|
||||
env.Append(CPPDEFINES = [
|
||||
('PACKAGE_VERSION', '\\"9.2.0-devel\\"'),
|
||||
('PACKAGE_VERSION', '\\"9.2.0-rc1\\"'),
|
||||
('PACKAGE_BUGREPORT', '\\"https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\\"'),
|
||||
])
|
||||
|
||||
|
@@ -6,7 +6,7 @@ dnl Tell the user about autoconf.html in the --help output
|
||||
m4_divert_once([HELP_END], [
|
||||
See docs/autoconf.html for more details on the options for Mesa.])
|
||||
|
||||
AC_INIT([Mesa], [9.2.0-devel],
|
||||
AC_INIT([Mesa], [9.2.0-rc1],
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa])
|
||||
AC_CONFIG_AUX_DIR([bin])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
|
@@ -52,6 +52,7 @@ Note: some of the new features are only available with certain drivers.
|
||||
<li>Added new freedreno gallium driver</li>
|
||||
<li>OSMesa interface for gallium llvmpipe/softpipe drivers</li>
|
||||
<li>Gallium Heads-Up Display (HUD) feature for performance monitoring</li>
|
||||
<li>Added support for UVD (2.2 and 3.0) video decoding on r600g and radeonsi through VDPAU (requires Kernel 3.10 or later)</li>
|
||||
</ul>
|
||||
|
||||
|
||||
@@ -70,7 +71,8 @@ Note: some of the new features are only available with certain drivers.
|
||||
the (unsupported) GDI driver.</li>
|
||||
<li>GL_EXT_separate_shader_objects has been removed from all Gallium drivers,
|
||||
because it disallows a critical GLSL shader optimization.
|
||||
GL_ARB_separate_shader_objects doesn't have this issue.
|
||||
GL_ARB_separate_shader_objects doesn't have this issue.</li>
|
||||
<li>i965 Gen6+ requires Kernel 3.6 or later. (92d2f5a)</li>
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
|
@@ -29,6 +29,10 @@ if HAVE_DRI_GLX
|
||||
SUBDIRS += glx
|
||||
endif
|
||||
|
||||
if HAVE_EGL_PLATFORM_WAYLAND
|
||||
SUBDIRS += egl/wayland
|
||||
endif
|
||||
|
||||
if HAVE_GBM
|
||||
SUBDIRS += gbm
|
||||
endif
|
||||
|
@@ -21,8 +21,4 @@
|
||||
|
||||
SUBDIRS=
|
||||
|
||||
if HAVE_EGL_PLATFORM_WAYLAND
|
||||
SUBDIRS += wayland
|
||||
endif
|
||||
|
||||
SUBDIRS += drivers main
|
||||
|
@@ -28,6 +28,7 @@ AM_CFLAGS = \
|
||||
-I$(top_srcdir)/src/egl/wayland/wayland-drm \
|
||||
-I$(top_builddir)/src/egl/wayland/wayland-drm \
|
||||
$(DEFINES) \
|
||||
$(VISIBILITY_CFLAGS) \
|
||||
$(LIBDRM_CFLAGS) \
|
||||
$(LIBUDEV_CFLAGS) \
|
||||
$(LIBKMS_CFLAGS) \
|
||||
|
@@ -743,6 +743,20 @@ dri2_swap_buffers_msc(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *draw,
|
||||
free(reply);
|
||||
}
|
||||
|
||||
/* Since we aren't watching for the server's invalidate events like we're
|
||||
* supposed to (due to XCB providing no mechanism for filtering the events
|
||||
* the way xlib does), and SwapBuffers is a common cause of invalidate
|
||||
* events, just shove one down to the driver, even though we haven't told
|
||||
* the driver that we're the kind of loader that provides reliable
|
||||
* invalidate events. This causes the driver to request buffers again at
|
||||
* its next draw, so that we get the correct buffers if a pageflip
|
||||
* happened. The driver should still be using the viewport hack to catch
|
||||
* window resizes.
|
||||
*/
|
||||
if (dri2_dpy->flush &&
|
||||
dri2_dpy->flush->base.version >= 3 && dri2_dpy->flush->invalidate)
|
||||
(*dri2_dpy->flush->invalidate)(dri2_surf->dri_drawable);
|
||||
|
||||
return swap_count;
|
||||
}
|
||||
|
||||
|
@@ -22,6 +22,7 @@
|
||||
AM_CFLAGS = \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src/egl/main \
|
||||
$(VISIBILITY_CFLAGS) \
|
||||
$(X11_CFLAGS) \
|
||||
$(DEFINES)
|
||||
|
||||
|
@@ -29,6 +29,7 @@ AM_CFLAGS = \
|
||||
-I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src/gbm/main \
|
||||
$(DEFINES) \
|
||||
$(VISIBILITY_CFLAGS) \
|
||||
$(EGL_CFLAGS) \
|
||||
-D_EGL_NATIVE_PLATFORM=$(EGL_NATIVE_PLATFORM) \
|
||||
-D_EGL_DRIVER_SEARCH_DIR=\"$(EGL_DRIVER_INSTALL_DIR)\" \
|
||||
|
@@ -1,6 +1,7 @@
|
||||
AM_CFLAGS = -I$(top_srcdir)/src/egl/main \
|
||||
-I$(top_srcdir)/include \
|
||||
$(DEFINES) \
|
||||
$(VISIBILITY_CFLAGS) \
|
||||
$(WAYLAND_CFLAGS)
|
||||
|
||||
noinst_LTLIBRARIES = libwayland-drm.la
|
||||
|
@@ -2,6 +2,7 @@ pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = wayland-egl.pc
|
||||
|
||||
AM_CFLAGS = $(DEFINES) \
|
||||
$(VISIBILITY_CFLAGS) \
|
||||
$(WAYLAND_CFLAGS)
|
||||
|
||||
lib_LTLIBRARIES = libwayland-egl.la
|
||||
|
@@ -58,7 +58,7 @@ draw_get_option_use_llvm(void)
|
||||
|
||||
#ifdef PIPE_ARCH_X86
|
||||
util_cpu_detect();
|
||||
/* require SSE2 due to LLVM PR6960. */
|
||||
/* require SSE2 due to LLVM PR6960. XXX Might be fixed by now? */
|
||||
if (!util_cpu_caps.has_sse2)
|
||||
value = FALSE;
|
||||
#endif
|
||||
@@ -78,6 +78,9 @@ draw_create_context(struct pipe_context *pipe, boolean try_llvm)
|
||||
if (draw == NULL)
|
||||
goto err_out;
|
||||
|
||||
/* we need correct cpu caps for disabling denorms in draw_vbo() */
|
||||
util_cpu_detect();
|
||||
|
||||
#if HAVE_LLVM
|
||||
if (try_llvm && draw_get_option_use_llvm()) {
|
||||
draw->llvm = draw_llvm_create(draw);
|
||||
|
@@ -77,6 +77,14 @@ void pp_debug(const char *, ...);
|
||||
struct program *pp_init_prog(struct pp_queue_t *, struct pipe_context *pipe,
|
||||
struct cso_context *);
|
||||
void pp_init_fbos(struct pp_queue_t *, unsigned int, unsigned int);
|
||||
void pp_blit(struct pipe_context *pipe,
|
||||
struct pipe_resource *src_tex,
|
||||
int srcX0, int srcY0,
|
||||
int srcX1, int srcY1,
|
||||
int srcZ0,
|
||||
struct pipe_surface *dst,
|
||||
int dstX0, int dstY0,
|
||||
int dstX1, int dstY1);
|
||||
|
||||
/* The filters */
|
||||
|
||||
|
@@ -31,7 +31,6 @@
|
||||
|
||||
#include "pipe/p_screen.h"
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/u_blit.h"
|
||||
#include "util/u_math.h"
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_memory.h"
|
||||
@@ -111,13 +110,6 @@ pp_init(struct pipe_context *pipe, const unsigned int *enabled,
|
||||
}
|
||||
}
|
||||
|
||||
ppq->p->blitctx = util_create_blit(ppq->p->pipe, cso);
|
||||
|
||||
if (ppq->p->blitctx == NULL) {
|
||||
pp_debug("Unable to create a blit context.\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
ppq->n_filters = curpos;
|
||||
ppq->n_tmp = (curpos > 2 ? 2 : 1);
|
||||
ppq->n_inner_tmp = tmp_req;
|
||||
@@ -180,11 +172,6 @@ pp_free(struct pp_queue_t *ppq)
|
||||
pp_free_fbos(ppq);
|
||||
|
||||
if (ppq && ppq->p) {
|
||||
/* Only destroy created contexts. */
|
||||
if (ppq->p->blitctx) {
|
||||
util_destroy_blit(ppq->p->blitctx);
|
||||
}
|
||||
|
||||
if (ppq->p->pipe && ppq->filters && ppq->shaders) {
|
||||
for (i = 0; i < ppq->n_filters; i++) {
|
||||
unsigned int filter = ppq->filters[i];
|
||||
|
@@ -43,7 +43,6 @@
|
||||
#include "postprocess/postprocess.h"
|
||||
#include "postprocess/pp_mlaa.h"
|
||||
#include "postprocess/pp_filters.h"
|
||||
#include "util/u_blit.h"
|
||||
#include "util/u_box.h"
|
||||
#include "util/u_sampler.h"
|
||||
#include "util/u_inlines.h"
|
||||
@@ -191,10 +190,9 @@ pp_jimenezmlaa_run(struct pp_queue_t *ppq, struct pipe_resource *in,
|
||||
pp_filter_set_fb(p);
|
||||
|
||||
/* Blit the input to the output */
|
||||
util_blit_pixels(p->blitctx, in, 0, 0, 0,
|
||||
w, h, 0, p->framebuffer.cbufs[0],
|
||||
0, 0, w, h, 0, PIPE_TEX_MIPFILTER_NEAREST,
|
||||
TGSI_WRITEMASK_XYZW, 0);
|
||||
pp_blit(p->pipe, in, 0, 0,
|
||||
w, h, 0, p->framebuffer.cbufs[0],
|
||||
0, 0, w, h);
|
||||
|
||||
u_sampler_view_default_template(&v_tmp, in, in->format);
|
||||
arr[0] = p->pipe->create_sampler_view(p->pipe, in, &v_tmp);
|
||||
|
@@ -56,8 +56,6 @@ struct program
|
||||
struct pipe_resource *vbuf;
|
||||
struct pipe_surface surf;
|
||||
struct pipe_sampler_view *view;
|
||||
|
||||
struct blit_state *blitctx;
|
||||
};
|
||||
|
||||
|
||||
|
@@ -28,12 +28,50 @@
|
||||
#include "postprocess.h"
|
||||
|
||||
#include "postprocess/pp_filters.h"
|
||||
#include "util/u_blit.h"
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/u_sampler.h"
|
||||
|
||||
#include "tgsi/tgsi_parse.h"
|
||||
|
||||
void
|
||||
pp_blit(struct pipe_context *pipe,
|
||||
struct pipe_resource *src_tex,
|
||||
int srcX0, int srcY0,
|
||||
int srcX1, int srcY1,
|
||||
int srcZ0,
|
||||
struct pipe_surface *dst,
|
||||
int dstX0, int dstY0,
|
||||
int dstX1, int dstY1)
|
||||
{
|
||||
struct pipe_blit_info blit;
|
||||
|
||||
memset(&blit, 0, sizeof(blit));
|
||||
|
||||
blit.src.resource = src_tex;
|
||||
blit.src.level = 0;
|
||||
blit.src.format = src_tex->format;
|
||||
blit.src.box.x = srcX0;
|
||||
blit.src.box.y = srcY0;
|
||||
blit.src.box.z = srcZ0;
|
||||
blit.src.box.width = srcX1 - srcX0;
|
||||
blit.src.box.height = srcY1 - srcY0;
|
||||
blit.src.box.depth = 1;
|
||||
|
||||
blit.dst.resource = dst->texture;
|
||||
blit.dst.level = dst->u.tex.level;
|
||||
blit.dst.format = dst->format;
|
||||
blit.dst.box.x = dstX0;
|
||||
blit.dst.box.y = dstY0;
|
||||
blit.dst.box.z = 0;
|
||||
blit.dst.box.width = dstX1 - dstX0;
|
||||
blit.dst.box.height = dstY1 - dstY0;
|
||||
blit.dst.box.depth = 1;
|
||||
|
||||
blit.mask = PIPE_MASK_RGBA;
|
||||
|
||||
pipe->blit(pipe, &blit);
|
||||
}
|
||||
|
||||
/**
|
||||
* Main run function of the PP queue. Called on swapbuffers/flush.
|
||||
*
|
||||
@@ -66,10 +104,10 @@ pp_run(struct pp_queue_t *ppq, struct pipe_resource *in,
|
||||
unsigned int w = ppq->p->framebuffer.width;
|
||||
unsigned int h = ppq->p->framebuffer.height;
|
||||
|
||||
util_blit_pixels(ppq->p->blitctx, in, 0, 0, 0,
|
||||
w, h, 0, ppq->tmps[0],
|
||||
0, 0, w, h, 0, PIPE_TEX_MIPFILTER_NEAREST,
|
||||
TGSI_WRITEMASK_XYZW, 0);
|
||||
|
||||
pp_blit(ppq->p->pipe, in, 0, 0,
|
||||
w, h, 0, ppq->tmps[0],
|
||||
0, 0, w, h);
|
||||
|
||||
in = ppq->tmp[0];
|
||||
}
|
||||
@@ -218,8 +256,8 @@ pp_tgsi_to_state(struct pipe_context *pipe, const char *text, bool isvs,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (tgsi_text_translate(text, tokens, Elements(tokens)) == FALSE) {
|
||||
pp_debug("Failed to translate %s\n", name);
|
||||
if (tgsi_text_translate(text, tokens, PP_MAX_TOKENS) == FALSE) {
|
||||
_debug_printf("pp: Failed to translate a shader for %s\n", name);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@@ -111,7 +111,6 @@ util_format_s3tc_init(void)
|
||||
util_dl_proc fetch_2d_texel_rgba_dxt3;
|
||||
util_dl_proc fetch_2d_texel_rgba_dxt5;
|
||||
util_dl_proc tx_compress_dxtn;
|
||||
char *force_s3tc_enable;
|
||||
|
||||
if (!first_time)
|
||||
return;
|
||||
@@ -122,15 +121,8 @@ util_format_s3tc_init(void)
|
||||
|
||||
library = util_dl_open(DXTN_LIBNAME);
|
||||
if (!library) {
|
||||
if ((force_s3tc_enable = getenv("force_s3tc_enable")) &&
|
||||
!strcmp(force_s3tc_enable, "true")) {
|
||||
debug_printf("couldn't open " DXTN_LIBNAME ", enabling DXTn due to "
|
||||
"force_s3tc_enable=true environment variable\n");
|
||||
util_format_s3tc_enabled = TRUE;
|
||||
} else {
|
||||
debug_printf("couldn't open " DXTN_LIBNAME ", software DXTn "
|
||||
"compression/decompression unavailable\n");
|
||||
}
|
||||
debug_printf("couldn't open " DXTN_LIBNAME ", software DXTn "
|
||||
"compression/decompression unavailable\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -32,8 +32,10 @@
|
||||
#include <fcntl.h>
|
||||
|
||||
#include <X11/Xlib-xcb.h>
|
||||
#include <X11/extensions/dri2tokens.h>
|
||||
#include <xcb/dri2.h>
|
||||
#include <xf86drm.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "pipe/p_screen.h"
|
||||
#include "pipe/p_context.h"
|
||||
@@ -305,6 +307,7 @@ vl_screen_create(Display *display, int screen)
|
||||
xcb_generic_error_t *error = NULL;
|
||||
char *device_name;
|
||||
int fd, device_name_length;
|
||||
unsigned int driverType;
|
||||
|
||||
drm_magic_t magic;
|
||||
|
||||
@@ -332,7 +335,22 @@ vl_screen_create(Display *display, int screen)
|
||||
s = xcb_setup_roots_iterator(xcb_get_setup(scrn->conn));
|
||||
while (screen--)
|
||||
xcb_screen_next(&s);
|
||||
connect_cookie = xcb_dri2_connect_unchecked(scrn->conn, s.data->root, XCB_DRI2_DRIVER_TYPE_DRI);
|
||||
driverType = XCB_DRI2_DRIVER_TYPE_DRI;
|
||||
#ifdef DRI2DriverPrimeShift
|
||||
{
|
||||
char *prime = getenv("DRI_PRIME");
|
||||
if (prime) {
|
||||
unsigned int primeid;
|
||||
errno = 0;
|
||||
primeid = strtoul(prime, NULL, 0);
|
||||
if (errno == 0)
|
||||
driverType |=
|
||||
((primeid & DRI2DriverPrimeMask) << DRI2DriverPrimeShift);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
connect_cookie = xcb_dri2_connect_unchecked(scrn->conn, s.data->root, driverType);
|
||||
connect = xcb_dri2_connect_reply(scrn->conn, connect_cookie, NULL);
|
||||
if (connect == NULL || connect->driver_name_length + connect->device_name_length == 0)
|
||||
goto free_screen;
|
||||
|
@@ -168,6 +168,8 @@ The integer capabilities:
|
||||
since they are linked) a driver can support. Returning 0 is equivalent
|
||||
to returning 1 because every driver has to support at least a single
|
||||
viewport/scissor combination.
|
||||
* ''PIPE_CAP_ENDIANNESS``:: The endianness of the device. Either
|
||||
PIPE_ENDIAN_BIG or PIPE_ENDIAN_LITTLE.
|
||||
|
||||
|
||||
.. _pipe_capf:
|
||||
|
@@ -227,6 +227,9 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_MAX_TEXEL_OFFSET:
|
||||
return 7;
|
||||
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
|
||||
default:
|
||||
DBG("unknown param %d", param);
|
||||
return 0;
|
||||
|
@@ -263,6 +263,8 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
|
||||
case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
|
||||
case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
|
||||
return 0;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
|
||||
default:
|
||||
debug_printf("%s: Unknown cap %u.\n", __FUNCTION__, cap);
|
||||
|
@@ -421,6 +421,8 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
|
||||
return 1 << 27;
|
||||
case PIPE_CAP_MAX_VIEWPORTS:
|
||||
return ILO_MAX_VIEWPORTS;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
|
||||
default:
|
||||
return 0;
|
||||
|
@@ -836,7 +836,7 @@ lp_build_depth_stencil_test(struct gallivm_state *gallivm,
|
||||
LLVMValueRef stencil_vals = NULL;
|
||||
LLVMValueRef z_bitmask = NULL, stencil_shift = NULL;
|
||||
LLVMValueRef z_pass = NULL, s_pass_mask = NULL;
|
||||
LLVMValueRef orig_mask = lp_build_mask_value(mask);
|
||||
LLVMValueRef current_mask = lp_build_mask_value(mask);
|
||||
LLVMValueRef front_facing = NULL;
|
||||
boolean have_z, have_s;
|
||||
|
||||
@@ -984,7 +984,7 @@ lp_build_depth_stencil_test(struct gallivm_state *gallivm,
|
||||
|
||||
/* apply stencil-fail operator */
|
||||
{
|
||||
LLVMValueRef s_fail_mask = lp_build_andnot(&s_bld, orig_mask, s_pass_mask);
|
||||
LLVMValueRef s_fail_mask = lp_build_andnot(&s_bld, current_mask, s_pass_mask);
|
||||
stencil_vals = lp_build_stencil_op(&s_bld, stencil, S_FAIL_OP,
|
||||
stencil_refs, stencil_vals,
|
||||
s_fail_mask, front_facing);
|
||||
@@ -1032,6 +1032,11 @@ lp_build_depth_stencil_test(struct gallivm_state *gallivm,
|
||||
/* compare src Z to dst Z, returning 'pass' mask */
|
||||
z_pass = lp_build_cmp(&z_bld, depth->func, z_src, z_dst);
|
||||
|
||||
/* mask off bits that failed stencil test */
|
||||
if (s_pass_mask) {
|
||||
current_mask = LLVMBuildAnd(builder, current_mask, s_pass_mask, "");
|
||||
}
|
||||
|
||||
if (!stencil[0].enabled) {
|
||||
/* We can potentially skip all remaining operations here, but only
|
||||
* if stencil is disabled because we still need to update the stencil
|
||||
@@ -1041,25 +1046,19 @@ lp_build_depth_stencil_test(struct gallivm_state *gallivm,
|
||||
|
||||
if (do_branch) {
|
||||
lp_build_mask_check(mask);
|
||||
do_branch = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (depth->writemask) {
|
||||
LLVMValueRef zselectmask;
|
||||
LLVMValueRef z_pass_mask;
|
||||
|
||||
/* mask off bits that failed Z test */
|
||||
zselectmask = LLVMBuildAnd(builder, orig_mask, z_pass, "");
|
||||
|
||||
/* mask off bits that failed stencil test */
|
||||
if (s_pass_mask) {
|
||||
zselectmask = LLVMBuildAnd(builder, zselectmask, s_pass_mask, "");
|
||||
}
|
||||
z_pass_mask = LLVMBuildAnd(builder, current_mask, z_pass, "");
|
||||
|
||||
/* Mix the old and new Z buffer values.
|
||||
* z_dst[i] = zselectmask[i] ? z_src[i] : z_dst[i]
|
||||
*/
|
||||
z_dst = lp_build_select(&z_bld, zselectmask, z_src, z_dst);
|
||||
z_dst = lp_build_select(&z_bld, z_pass_mask, z_src, z_dst);
|
||||
}
|
||||
|
||||
if (stencil[0].enabled) {
|
||||
@@ -1067,13 +1066,13 @@ lp_build_depth_stencil_test(struct gallivm_state *gallivm,
|
||||
LLVMValueRef z_fail_mask, z_pass_mask;
|
||||
|
||||
/* apply Z-fail operator */
|
||||
z_fail_mask = lp_build_andnot(&s_bld, orig_mask, z_pass);
|
||||
z_fail_mask = lp_build_andnot(&s_bld, current_mask, z_pass);
|
||||
stencil_vals = lp_build_stencil_op(&s_bld, stencil, Z_FAIL_OP,
|
||||
stencil_refs, stencil_vals,
|
||||
z_fail_mask, front_facing);
|
||||
|
||||
/* apply Z-pass operator */
|
||||
z_pass_mask = LLVMBuildAnd(builder, orig_mask, z_pass, "");
|
||||
z_pass_mask = LLVMBuildAnd(builder, current_mask, z_pass, "");
|
||||
stencil_vals = lp_build_stencil_op(&s_bld, stencil, Z_PASS_OP,
|
||||
stencil_refs, stencil_vals,
|
||||
z_pass_mask, front_facing);
|
||||
@@ -1083,7 +1082,7 @@ lp_build_depth_stencil_test(struct gallivm_state *gallivm,
|
||||
/* No depth test: apply Z-pass operator to stencil buffer values which
|
||||
* passed the stencil test.
|
||||
*/
|
||||
s_pass_mask = LLVMBuildAnd(builder, orig_mask, s_pass_mask, "");
|
||||
s_pass_mask = LLVMBuildAnd(builder, current_mask, s_pass_mask, "");
|
||||
stencil_vals = lp_build_stencil_op(&s_bld, stencil, Z_PASS_OP,
|
||||
stencil_refs, stencil_vals,
|
||||
s_pass_mask, front_facing);
|
||||
|
@@ -231,6 +231,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
|
||||
return 0;
|
||||
case PIPE_CAP_MAX_VIEWPORTS:
|
||||
return PIPE_MAX_VIEWPORTS;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_NATIVE;
|
||||
}
|
||||
/* should only get here on unhandled cases */
|
||||
debug_printf("Unexpected PIPE_CAP %d query\n", param);
|
||||
|
@@ -111,9 +111,6 @@ nv30_format_info_table[PIPE_FORMAT_COUNT] = {
|
||||
_(R16G16_SNORM , __V_),
|
||||
_(R16G16B16_SNORM , __V_),
|
||||
_(R16G16B16A16_SNORM , __V_),
|
||||
_(R8_USCALED , __V_),
|
||||
_(R8G8_USCALED , __V_),
|
||||
_(R8G8B8_USCALED , __V_),
|
||||
_(R8G8B8A8_USCALED , __V_),
|
||||
_(R16_FLOAT , __V_),
|
||||
_(R16G16_FLOAT , __V_), //S_V_),
|
||||
@@ -160,9 +157,6 @@ nv30_vtxfmt_table[PIPE_FORMAT_COUNT] = {
|
||||
_(R8G8_UNORM , U8_UNORM , 2),
|
||||
_(R8G8B8_UNORM , U8_UNORM , 3),
|
||||
_(R8G8B8A8_UNORM , U8_UNORM , 4),
|
||||
_(R8_USCALED , U8_USCALED , 1),
|
||||
_(R8G8_USCALED , U8_USCALED , 2),
|
||||
_(R8G8B8_USCALED , U8_USCALED , 3),
|
||||
_(R8G8B8A8_USCALED , U8_USCALED , 4),
|
||||
_(R16_SNORM , V16_SNORM , 1),
|
||||
_(R16G16_SNORM , V16_SNORM , 2),
|
||||
|
@@ -130,6 +130,8 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
|
||||
case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
|
||||
return 1;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
default:
|
||||
debug_printf("unknown param %d\n", param);
|
||||
return 0;
|
||||
|
@@ -40,13 +40,15 @@ nv30_emit_vtxattr(struct nv30_context *nv30, struct pipe_vertex_buffer *vb,
|
||||
const unsigned nc = util_format_get_nr_components(ve->src_format);
|
||||
struct nouveau_pushbuf *push = nv30->base.pushbuf;
|
||||
struct nv04_resource *res = nv04_resource(vb->buffer);
|
||||
const struct util_format_description *desc =
|
||||
util_format_description(ve->src_format);
|
||||
const void *data;
|
||||
float v[4];
|
||||
|
||||
data = nouveau_resource_map_offset(&nv30->base, res, vb->buffer_offset +
|
||||
ve->src_offset, NOUVEAU_BO_RD);
|
||||
|
||||
util_format_read_4f(ve->src_format, v, 0, data, 0, 0, 0, 1, 1);
|
||||
desc->unpack_rgba_float(v, 0, data, 0, 1, 1);
|
||||
|
||||
switch (nc) {
|
||||
case 4:
|
||||
|
@@ -189,6 +189,8 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
return 0;
|
||||
case PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK:
|
||||
return PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
default:
|
||||
NOUVEAU_ERR("unknown PIPE_CAP %d\n", param);
|
||||
return 0;
|
||||
|
@@ -40,7 +40,7 @@ struct nv50_constbuf {
|
||||
const uint8_t *data;
|
||||
} u;
|
||||
uint32_t size; /* max 65536 */
|
||||
uint16_t offset;
|
||||
uint32_t offset;
|
||||
boolean user; /* should only be TRUE if u.data is valid and non-NULL */
|
||||
};
|
||||
|
||||
|
@@ -140,10 +140,20 @@ nv50_emit_vtxattr(struct nv50_context *nv50, struct pipe_vertex_buffer *vb,
|
||||
const void *data = (const uint8_t *)vb->user_buffer + ve->src_offset;
|
||||
float v[4];
|
||||
const unsigned nc = util_format_get_nr_components(ve->src_format);
|
||||
const struct util_format_description *desc =
|
||||
util_format_description(ve->src_format);
|
||||
|
||||
assert(vb->user_buffer);
|
||||
|
||||
util_format_read_4f(ve->src_format, v, 0, data, 0, 0, 0, 1, 1);
|
||||
if (desc->channel[0].pure_integer) {
|
||||
if (desc->channel[0].type == UTIL_FORMAT_TYPE_SIGNED) {
|
||||
desc->unpack_rgba_sint((int32_t *)v, 0, data, 0, 1, 1);
|
||||
} else {
|
||||
desc->unpack_rgba_uint((uint32_t *)v, 0, data, 0, 1, 1);
|
||||
}
|
||||
} else {
|
||||
desc->unpack_rgba_float(v, 0, data, 0, 1, 1);
|
||||
}
|
||||
|
||||
switch (nc) {
|
||||
case 4:
|
||||
|
@@ -624,17 +624,13 @@ nv84_video_buffer_create(struct pipe_context *pipe,
|
||||
union nouveau_bo_config cfg;
|
||||
unsigned bo_size;
|
||||
|
||||
if (getenv("XVMC_VL"))
|
||||
if (getenv("XVMC_VL") || template->buffer_format != PIPE_FORMAT_NV12)
|
||||
return vl_video_buffer_create(pipe, template);
|
||||
|
||||
if (!template->interlaced) {
|
||||
debug_printf("Require interlaced video buffers\n");
|
||||
return NULL;
|
||||
}
|
||||
if (template->buffer_format != PIPE_FORMAT_NV12) {
|
||||
debug_printf("Must use NV12 format\n");
|
||||
return NULL;
|
||||
}
|
||||
if (template->chroma_format != PIPE_VIDEO_CHROMA_FORMAT_420) {
|
||||
debug_printf("Must use 4:2:0 format\n");
|
||||
return NULL;
|
||||
|
@@ -136,12 +136,11 @@ nv84_decoder_bsp(struct nv84_decoder *dec,
|
||||
params.iseqparm.chroma_format_idc = 1;
|
||||
|
||||
params.iseqparm.pic_width_in_mbs_minus1 = mb(dec->base.width) - 1;
|
||||
if (desc->field_pic_flag)
|
||||
if (desc->field_pic_flag || desc->mb_adaptive_frame_field_flag)
|
||||
params.iseqparm.pic_height_in_map_units_minus1 = mb_half(dec->base.height) - 1;
|
||||
else
|
||||
params.iseqparm.pic_height_in_map_units_minus1 = mb(dec->base.height) - 1;
|
||||
|
||||
/* TODO: interlaced still doesn't work, maybe due to ref frame management. */
|
||||
if (desc->bottom_field_flag)
|
||||
params.ipicparm.curr_pic_order_cnt = desc->field_order_cnt[1];
|
||||
else
|
||||
|
@@ -39,10 +39,10 @@ struct h264_iparm1 {
|
||||
uint32_t h1; // 1fc
|
||||
uint32_t h2; // 200
|
||||
uint32_t h3; // 204
|
||||
uint32_t unk208;
|
||||
uint32_t field_pic_flag;
|
||||
uint32_t format;
|
||||
uint32_t unk214;
|
||||
uint32_t mb_adaptive_frame_field_flag; // 208
|
||||
uint32_t field_pic_flag; // 20c
|
||||
uint32_t format; // 210
|
||||
uint32_t unk214; // 214
|
||||
};
|
||||
|
||||
struct h264_iparm2 {
|
||||
@@ -56,7 +56,7 @@ struct h264_iparm2 {
|
||||
uint32_t h2; // 1c
|
||||
uint32_t h3; // 20
|
||||
uint32_t unk24;
|
||||
uint32_t unk28;
|
||||
uint32_t mb_adaptive_frame_field_flag; // 28
|
||||
uint32_t top; // 2c
|
||||
uint32_t bottom; // 30
|
||||
uint32_t is_reference; // 34
|
||||
@@ -100,6 +100,7 @@ nv84_decoder_vp_h264(struct nv84_decoder *dec,
|
||||
param1.height = param1.h2 = height;
|
||||
param1.h1 = param1.h3 = align(height, 32);
|
||||
param1.format = 0x3231564e; /* 'NV12' */
|
||||
param1.mb_adaptive_frame_field_flag = desc->mb_adaptive_frame_field_flag;
|
||||
param1.field_pic_flag = desc->field_pic_flag;
|
||||
|
||||
param2.width = width;
|
||||
@@ -115,6 +116,7 @@ nv84_decoder_vp_h264(struct nv84_decoder *dec,
|
||||
param2.top = desc->bottom_field_flag ? 2 : 1;
|
||||
param2.bottom = desc->bottom_field_flag;
|
||||
}
|
||||
param2.mb_adaptive_frame_field_flag = desc->mb_adaptive_frame_field_flag;
|
||||
param2.is_reference = desc->is_reference;
|
||||
|
||||
PUSH_SPACE(push, 5 + 16 + 3 + 2 + 6 + (is_ref ? 2 : 0) + 3 + 2 + 4 + 2);
|
||||
|
@@ -179,6 +179,8 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||
return 1;
|
||||
case PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK:
|
||||
return PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
default:
|
||||
NOUVEAU_ERR("unknown PIPE_CAP %d\n", param);
|
||||
return 0;
|
||||
@@ -510,6 +512,7 @@ nvc0_screen_resize_tls_area(struct nvc0_screen *screen,
|
||||
}
|
||||
|
||||
size *= (screen->base.device->chipset >= 0xe0) ? 64 : 48; /* max warps */
|
||||
size = align(size, 0x8000);
|
||||
size *= screen->mp_count;
|
||||
|
||||
size = align(size, 1 << 17);
|
||||
|
@@ -38,7 +38,7 @@ struct nvc0_constbuf {
|
||||
const void *data;
|
||||
} u;
|
||||
uint32_t size;
|
||||
uint16_t offset;
|
||||
uint32_t offset;
|
||||
boolean user; /* should only be TRUE if u.data is valid and non-NULL */
|
||||
};
|
||||
|
||||
|
@@ -153,7 +153,7 @@ static void nvc0_video_getpath(enum pipe_video_profile profile, char *path)
|
||||
break;
|
||||
}
|
||||
case PIPE_VIDEO_CODEC_VC1: {
|
||||
sprintf(path, "/lib/firmware/nouveau/vuc-vc1-%u", profile - PIPE_VIDEO_PROFILE_VC1_SIMPLE);
|
||||
sprintf(path, "/lib/firmware/nouveau/vuc-vc1-0");
|
||||
break;
|
||||
}
|
||||
case PIPE_VIDEO_CODEC_MPEG4_AVC: {
|
||||
|
@@ -78,11 +78,11 @@ nve4_screen_compute_setup(struct nvc0_screen *screen,
|
||||
*/
|
||||
BEGIN_NVC0(push, NVE4_COMPUTE(MP_TEMP_SIZE_HIGH(0)), 3);
|
||||
PUSH_DATAh(push, screen->tls->size / screen->mp_count);
|
||||
PUSH_DATA (push, screen->tls->size / screen->mp_count);
|
||||
PUSH_DATA (push, (screen->tls->size / screen->mp_count) & ~0x7fff);
|
||||
PUSH_DATA (push, 0xff);
|
||||
BEGIN_NVC0(push, NVE4_COMPUTE(MP_TEMP_SIZE_HIGH(1)), 3);
|
||||
PUSH_DATAh(push, screen->tls->size / screen->mp_count);
|
||||
PUSH_DATA (push, screen->tls->size / screen->mp_count);
|
||||
PUSH_DATA (push, (screen->tls->size / screen->mp_count) & ~0x7fff);
|
||||
PUSH_DATA (push, 0xff);
|
||||
|
||||
/* Unified address space ? Who needs that ? Certainly not OpenCL.
|
||||
|
@@ -18,7 +18,8 @@ AM_CFLAGS = \
|
||||
$(RADEON_CFLAGS)
|
||||
|
||||
r300_compiler_tests_LDADD = libr300.la libr300-helper.la \
|
||||
$(top_builddir)/src/gallium/auxiliary/libgallium.la
|
||||
$(top_builddir)/src/gallium/auxiliary/libgallium.la \
|
||||
$(GALLIUM_DRI_LIB_DEPS)
|
||||
r300_compiler_tests_CPPFLAGS = \
|
||||
-I$(top_srcdir)/src/gallium/drivers/r300/compiler
|
||||
r300_compiler_tests_SOURCES = \
|
||||
|
@@ -80,7 +80,7 @@ static void test_runner_rc_optimize(struct test_result * result)
|
||||
|
||||
unsigned radeon_compiler_optimize_run_tests()
|
||||
{
|
||||
struct test tests[] = {
|
||||
static struct test tests[] = {
|
||||
{"rc_optimize() => peephole_mul_omod()", test_runner_rc_optimize},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
@@ -91,8 +91,8 @@ static void tex_1d_swizzle(struct test_result *result)
|
||||
|
||||
unsigned radeon_compiler_regalloc_run_tests()
|
||||
{
|
||||
struct test tests[] = {
|
||||
{"rc_pair_regalloc() => TEX 1D Swizzle - r300", tex_1d_swizzle},
|
||||
static struct test tests[] = {
|
||||
{"rc_pair_regalloc() => TEX 1D Swizzle - r300", tex_1d_swizzle },
|
||||
{NULL, NULL}
|
||||
};
|
||||
return run_tests(tests);
|
||||
|
@@ -96,7 +96,7 @@ static void test_runner_rc_inst_can_use_presub(struct test_result * result)
|
||||
|
||||
unsigned radeon_compiler_util_run_tests()
|
||||
{
|
||||
struct test tests[] = {
|
||||
static struct test tests[] = {
|
||||
{"rc_inst_can_use_presub()", test_runner_rc_inst_can_use_presub},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
@@ -104,7 +104,6 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
|
||||
case PIPE_CAP_USER_INDEX_BUFFERS:
|
||||
case PIPE_CAP_USER_CONSTANT_BUFFERS:
|
||||
case PIPE_CAP_DEPTH_CLIP_DISABLE: /* XXX implemented, but breaks Regnum Online */
|
||||
case PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER:
|
||||
return 1;
|
||||
|
||||
@@ -138,6 +137,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
|
||||
case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
|
||||
case PIPE_CAP_INDEP_BLEND_ENABLE:
|
||||
case PIPE_CAP_INDEP_BLEND_FUNC:
|
||||
case PIPE_CAP_DEPTH_CLIP_DISABLE:
|
||||
case PIPE_CAP_SHADER_STENCIL_EXPORT:
|
||||
case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
|
||||
case PIPE_CAP_TGSI_INSTANCEID:
|
||||
@@ -190,6 +190,8 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
|
||||
/* Render targets. */
|
||||
case PIPE_CAP_MAX_RENDER_TARGETS:
|
||||
return 4;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1333,8 +1333,7 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
|
||||
|
||||
if (r300_screen(pipe->screen)->caps.has_tcl) {
|
||||
vap_clip_cntl = (state->clip_plane_enable & 63) |
|
||||
R300_PS_UCP_MODE_CLIP_AS_TRIFAN |
|
||||
(state->depth_clip ? 0 : R300_CLIP_DISABLE);
|
||||
R300_PS_UCP_MODE_CLIP_AS_TRIFAN;
|
||||
} else {
|
||||
vap_clip_cntl = R300_CLIP_DISABLE;
|
||||
}
|
||||
|
@@ -679,6 +679,8 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
|
||||
|
||||
case PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK:
|
||||
return PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_R600;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -1490,7 +1490,8 @@ unsigned post_scheduler::try_add_instruction(node *n) {
|
||||
|
||||
// FIXME workaround for some problems with MULADD in trans slot on r700,
|
||||
// (is it really needed on r600?)
|
||||
if (a->bc.op == ALU_OP3_MULADD && !ctx.is_egcm()) {
|
||||
if ((a->bc.op == ALU_OP3_MULADD || a->bc.op == ALU_OP3_MULADD_IEEE) &&
|
||||
!ctx.is_egcm()) {
|
||||
allowed_slots &= 0x0F;
|
||||
}
|
||||
|
||||
|
@@ -124,7 +124,7 @@ unsigned radeon_llvm_compile(LLVMModuleRef M, struct radeon_llvm_binary *binary,
|
||||
r = LLVMTargetMachineEmitToMemoryBuffer(tm, M, LLVMObjectFile, &err,
|
||||
&out_buffer);
|
||||
if (r) {
|
||||
fprintf(stderr, err);
|
||||
fprintf(stderr, "%s", err);
|
||||
FREE(err);
|
||||
return 1;
|
||||
}
|
||||
|
@@ -440,6 +440,8 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
|
||||
|
||||
case PIPE_CAP_MAX_TEXEL_OFFSET:
|
||||
return 7;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@@ -562,12 +562,11 @@ static void si_alpha_test(struct lp_build_tgsi_context *bld_base,
|
||||
}
|
||||
|
||||
static void si_llvm_emit_clipvertex(struct lp_build_tgsi_context * bld_base,
|
||||
unsigned index)
|
||||
LLVMValueRef (*pos)[9], unsigned index)
|
||||
{
|
||||
struct si_shader_context *si_shader_ctx = si_shader_context(bld_base);
|
||||
struct lp_build_context *base = &bld_base->base;
|
||||
struct lp_build_context *uint = &si_shader_ctx->radeon_bld.soa.bld_base.uint_bld;
|
||||
LLVMValueRef args[9];
|
||||
unsigned reg_index;
|
||||
unsigned chan;
|
||||
unsigned const_chan;
|
||||
@@ -582,6 +581,8 @@ static void si_llvm_emit_clipvertex(struct lp_build_tgsi_context * bld_base,
|
||||
}
|
||||
|
||||
for (reg_index = 0; reg_index < 2; reg_index ++) {
|
||||
LLVMValueRef *args = pos[2 + reg_index];
|
||||
|
||||
args[5] =
|
||||
args[6] =
|
||||
args[7] =
|
||||
@@ -612,10 +613,6 @@ static void si_llvm_emit_clipvertex(struct lp_build_tgsi_context * bld_base,
|
||||
args[3] = lp_build_const_int32(base->gallivm,
|
||||
V_008DFC_SQ_EXP_POS + 2 + reg_index);
|
||||
args[4] = uint->zero;
|
||||
lp_build_intrinsic(base->gallivm->builder,
|
||||
"llvm.SI.export",
|
||||
LLVMVoidTypeInContext(base->gallivm->context),
|
||||
args, 9);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -630,17 +627,18 @@ static void si_llvm_emit_epilogue(struct lp_build_tgsi_context * bld_base)
|
||||
struct tgsi_parse_context *parse = &si_shader_ctx->parse;
|
||||
LLVMValueRef args[9];
|
||||
LLVMValueRef last_args[9] = { 0 };
|
||||
LLVMValueRef pos_args[4][9] = { { 0 } };
|
||||
unsigned semantic_name;
|
||||
unsigned color_count = 0;
|
||||
unsigned param_count = 0;
|
||||
int depth_index = -1, stencil_index = -1;
|
||||
int i;
|
||||
|
||||
while (!tgsi_parse_end_of_tokens(parse)) {
|
||||
struct tgsi_full_declaration *d =
|
||||
&parse->FullToken.FullDeclaration;
|
||||
unsigned target;
|
||||
unsigned index;
|
||||
int i;
|
||||
|
||||
tgsi_parse_token(parse);
|
||||
|
||||
@@ -716,7 +714,7 @@ handle_semantic:
|
||||
target = V_008DFC_SQ_EXP_POS + 2 + d->Semantic.Index;
|
||||
break;
|
||||
case TGSI_SEMANTIC_CLIPVERTEX:
|
||||
si_llvm_emit_clipvertex(bld_base, index);
|
||||
si_llvm_emit_clipvertex(bld_base, pos_args, index);
|
||||
shader->clip_dist_write = 0xFF;
|
||||
continue;
|
||||
case TGSI_SEMANTIC_FOG:
|
||||
@@ -734,9 +732,13 @@ handle_semantic:
|
||||
|
||||
si_llvm_init_export_args(bld_base, d, index, target, args);
|
||||
|
||||
if (si_shader_ctx->type == TGSI_PROCESSOR_VERTEX ?
|
||||
(semantic_name == TGSI_SEMANTIC_POSITION) :
|
||||
(semantic_name == TGSI_SEMANTIC_COLOR)) {
|
||||
if (si_shader_ctx->type == TGSI_PROCESSOR_VERTEX &&
|
||||
target >= V_008DFC_SQ_EXP_POS &&
|
||||
target <= (V_008DFC_SQ_EXP_POS + 3)) {
|
||||
memcpy(pos_args[target - V_008DFC_SQ_EXP_POS],
|
||||
args, sizeof(args));
|
||||
} else if (si_shader_ctx->type == TGSI_PROCESSOR_FRAGMENT &&
|
||||
semantic_name == TGSI_SEMANTIC_COLOR) {
|
||||
if (last_args[0]) {
|
||||
lp_build_intrinsic(base->gallivm->builder,
|
||||
"llvm.SI.export",
|
||||
@@ -806,66 +808,87 @@ handle_semantic:
|
||||
memcpy(last_args, args, sizeof(args));
|
||||
}
|
||||
|
||||
if (!last_args[0]) {
|
||||
assert(si_shader_ctx->type == TGSI_PROCESSOR_FRAGMENT);
|
||||
if (si_shader_ctx->type == TGSI_PROCESSOR_VERTEX) {
|
||||
unsigned pos_idx = 0;
|
||||
|
||||
/* Specify which components to enable */
|
||||
last_args[0] = lp_build_const_int32(base->gallivm, 0x0);
|
||||
for (i = 0; i < 4; i++)
|
||||
if (pos_args[i][0])
|
||||
shader->nr_pos_exports++;
|
||||
|
||||
/* Specify the target we are exporting */
|
||||
last_args[3] = lp_build_const_int32(base->gallivm, V_008DFC_SQ_EXP_MRT);
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (!pos_args[i][0])
|
||||
continue;
|
||||
|
||||
/* Set COMPR flag to zero to export data as 32-bit */
|
||||
last_args[4] = uint->zero;
|
||||
|
||||
/* dummy bits */
|
||||
last_args[5]= uint->zero;
|
||||
last_args[6]= uint->zero;
|
||||
last_args[7]= uint->zero;
|
||||
last_args[8]= uint->zero;
|
||||
|
||||
si_shader_ctx->shader->spi_shader_col_format |=
|
||||
V_028714_SPI_SHADER_32_ABGR;
|
||||
si_shader_ctx->shader->cb_shader_mask |= S_02823C_OUTPUT0_ENABLE(0xf);
|
||||
}
|
||||
|
||||
/* Specify whether the EXEC mask represents the valid mask */
|
||||
last_args[1] = lp_build_const_int32(base->gallivm,
|
||||
si_shader_ctx->type == TGSI_PROCESSOR_FRAGMENT);
|
||||
|
||||
if (shader->fs_write_all && shader->nr_cbufs > 1) {
|
||||
int i;
|
||||
|
||||
/* Specify that this is not yet the last export */
|
||||
last_args[2] = lp_build_const_int32(base->gallivm, 0);
|
||||
|
||||
for (i = 1; i < shader->nr_cbufs; i++) {
|
||||
/* Specify the target we are exporting */
|
||||
last_args[3] = lp_build_const_int32(base->gallivm,
|
||||
V_008DFC_SQ_EXP_MRT + i);
|
||||
pos_args[i][3] = lp_build_const_int32(base->gallivm, V_008DFC_SQ_EXP_POS + pos_idx++);
|
||||
|
||||
if (pos_idx == shader->nr_pos_exports)
|
||||
/* Specify that this is the last export */
|
||||
pos_args[i][2] = uint->one;
|
||||
|
||||
lp_build_intrinsic(base->gallivm->builder,
|
||||
"llvm.SI.export",
|
||||
LLVMVoidTypeInContext(base->gallivm->context),
|
||||
last_args, 9);
|
||||
pos_args[i], 9);
|
||||
}
|
||||
} else {
|
||||
if (!last_args[0]) {
|
||||
/* Specify which components to enable */
|
||||
last_args[0] = lp_build_const_int32(base->gallivm, 0x0);
|
||||
|
||||
/* Specify the target we are exporting */
|
||||
last_args[3] = lp_build_const_int32(base->gallivm, V_008DFC_SQ_EXP_MRT);
|
||||
|
||||
/* Set COMPR flag to zero to export data as 32-bit */
|
||||
last_args[4] = uint->zero;
|
||||
|
||||
/* dummy bits */
|
||||
last_args[5]= uint->zero;
|
||||
last_args[6]= uint->zero;
|
||||
last_args[7]= uint->zero;
|
||||
last_args[8]= uint->zero;
|
||||
|
||||
si_shader_ctx->shader->spi_shader_col_format |=
|
||||
si_shader_ctx->shader->spi_shader_col_format << 4;
|
||||
si_shader_ctx->shader->cb_shader_mask |=
|
||||
si_shader_ctx->shader->cb_shader_mask << 4;
|
||||
V_028714_SPI_SHADER_32_ABGR;
|
||||
si_shader_ctx->shader->cb_shader_mask |= S_02823C_OUTPUT0_ENABLE(0xf);
|
||||
}
|
||||
|
||||
last_args[3] = lp_build_const_int32(base->gallivm, V_008DFC_SQ_EXP_MRT);
|
||||
/* Specify whether the EXEC mask represents the valid mask */
|
||||
last_args[1] = uint->one;
|
||||
|
||||
if (shader->fs_write_all && shader->nr_cbufs > 1) {
|
||||
int i;
|
||||
|
||||
/* Specify that this is not yet the last export */
|
||||
last_args[2] = lp_build_const_int32(base->gallivm, 0);
|
||||
|
||||
for (i = 1; i < shader->nr_cbufs; i++) {
|
||||
/* Specify the target we are exporting */
|
||||
last_args[3] = lp_build_const_int32(base->gallivm,
|
||||
V_008DFC_SQ_EXP_MRT + i);
|
||||
|
||||
lp_build_intrinsic(base->gallivm->builder,
|
||||
"llvm.SI.export",
|
||||
LLVMVoidTypeInContext(base->gallivm->context),
|
||||
last_args, 9);
|
||||
|
||||
si_shader_ctx->shader->spi_shader_col_format |=
|
||||
si_shader_ctx->shader->spi_shader_col_format << 4;
|
||||
si_shader_ctx->shader->cb_shader_mask |=
|
||||
si_shader_ctx->shader->cb_shader_mask << 4;
|
||||
}
|
||||
|
||||
last_args[3] = lp_build_const_int32(base->gallivm, V_008DFC_SQ_EXP_MRT);
|
||||
}
|
||||
|
||||
/* Specify that this is the last export */
|
||||
last_args[2] = lp_build_const_int32(base->gallivm, 1);
|
||||
|
||||
lp_build_intrinsic(base->gallivm->builder,
|
||||
"llvm.SI.export",
|
||||
LLVMVoidTypeInContext(base->gallivm->context),
|
||||
last_args, 9);
|
||||
}
|
||||
|
||||
/* Specify that this is the last export */
|
||||
last_args[2] = lp_build_const_int32(base->gallivm, 1);
|
||||
|
||||
lp_build_intrinsic(base->gallivm->builder,
|
||||
"llvm.SI.export",
|
||||
LLVMVoidTypeInContext(base->gallivm->context),
|
||||
last_args, 9);
|
||||
|
||||
/* XXX: Look up what this function does */
|
||||
/* ctx->shader->output[i].spi_sid = r600_spi_sid(&ctx->shader->output[i]);*/
|
||||
}
|
||||
|
@@ -113,6 +113,7 @@ struct si_shader {
|
||||
bool vs_out_misc_write;
|
||||
bool vs_out_point_size;
|
||||
unsigned nr_cbufs;
|
||||
unsigned nr_pos_exports;
|
||||
unsigned clip_dist_write;
|
||||
};
|
||||
|
||||
|
@@ -74,13 +74,13 @@ static void si_pipe_shader_vs(struct pipe_context *ctx, struct si_pipe_shader *s
|
||||
|
||||
si_pm4_set_reg(pm4, R_02870C_SPI_SHADER_POS_FORMAT,
|
||||
S_02870C_POS0_EXPORT_FORMAT(V_02870C_SPI_SHADER_4COMP) |
|
||||
S_02870C_POS1_EXPORT_FORMAT(shader->shader.vs_out_misc_write ?
|
||||
S_02870C_POS1_EXPORT_FORMAT(shader->shader.nr_pos_exports > 1 ?
|
||||
V_02870C_SPI_SHADER_4COMP :
|
||||
V_02870C_SPI_SHADER_NONE) |
|
||||
S_02870C_POS2_EXPORT_FORMAT((shader->shader.clip_dist_write & 0x0F) ?
|
||||
S_02870C_POS2_EXPORT_FORMAT(shader->shader.nr_pos_exports > 2 ?
|
||||
V_02870C_SPI_SHADER_4COMP :
|
||||
V_02870C_SPI_SHADER_NONE) |
|
||||
S_02870C_POS3_EXPORT_FORMAT((shader->shader.clip_dist_write & 0xF0) ?
|
||||
S_02870C_POS3_EXPORT_FORMAT(shader->shader.nr_pos_exports > 3 ?
|
||||
V_02870C_SPI_SHADER_4COMP :
|
||||
V_02870C_SPI_SHADER_NONE));
|
||||
|
||||
@@ -91,10 +91,10 @@ static void si_pipe_shader_vs(struct pipe_context *ctx, struct si_pipe_shader *s
|
||||
|
||||
num_user_sgprs = SI_VS_NUM_USER_SGPR;
|
||||
num_sgprs = shader->num_sgprs;
|
||||
if (num_user_sgprs > num_sgprs)
|
||||
num_sgprs = num_user_sgprs;
|
||||
/* Last 2 reserved SGPRs are used for VCC */
|
||||
num_sgprs += 2;
|
||||
if (num_user_sgprs > num_sgprs) {
|
||||
/* Last 2 reserved SGPRs are used for VCC */
|
||||
num_sgprs = num_user_sgprs + 2;
|
||||
}
|
||||
assert(num_sgprs <= 104);
|
||||
|
||||
vgpr_comp_cnt = shader->shader.uses_instanceid ? 3 : 0;
|
||||
@@ -235,10 +235,10 @@ static void si_pipe_shader_ps(struct pipe_context *ctx, struct si_pipe_shader *s
|
||||
|
||||
num_user_sgprs = SI_PS_NUM_USER_SGPR;
|
||||
num_sgprs = shader->num_sgprs;
|
||||
if (num_user_sgprs > num_sgprs)
|
||||
num_sgprs = num_user_sgprs;
|
||||
/* Last 2 reserved SGPRs are used for VCC */
|
||||
num_sgprs += 2;
|
||||
if (num_user_sgprs > num_sgprs) {
|
||||
/* Last 2 reserved SGPRs are used for VCC */
|
||||
num_sgprs = num_user_sgprs + 2;
|
||||
}
|
||||
assert(num_sgprs <= 104);
|
||||
|
||||
si_pm4_set_reg(pm4, R_00B028_SPI_SHADER_PGM_RSRC1_PS,
|
||||
|
@@ -183,6 +183,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
|
||||
return 0;
|
||||
case PIPE_CAP_MAX_VIEWPORTS:
|
||||
return 1;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_NATIVE;
|
||||
}
|
||||
/* should only get here on unhandled cases */
|
||||
debug_printf("Unexpected PIPE_CAP %d query\n", param);
|
||||
|
@@ -270,6 +270,8 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
|
||||
return 1;
|
||||
case PIPE_CAP_MAX_VIEWPORTS:
|
||||
return 1;
|
||||
case PIPE_CAP_ENDIANNESS:
|
||||
return PIPE_ENDIAN_LITTLE;
|
||||
}
|
||||
|
||||
debug_printf("Unexpected PIPE_CAP_ query %u\n", param);
|
||||
|
@@ -507,12 +507,22 @@ enum pipe_cap {
|
||||
PIPE_CAP_QUERY_PIPELINE_STATISTICS = 81,
|
||||
PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK = 82,
|
||||
PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE = 83,
|
||||
PIPE_CAP_MAX_VIEWPORTS = 84
|
||||
PIPE_CAP_MAX_VIEWPORTS = 84,
|
||||
PIPE_CAP_ENDIANNESS = 85
|
||||
};
|
||||
|
||||
#define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)
|
||||
#define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_R600 (1 << 1)
|
||||
|
||||
enum pipe_endian {
|
||||
PIPE_ENDIAN_LITTLE = 0,
|
||||
PIPE_ENDIAN_BIG = 1,
|
||||
#if defined(PIPE_ARCH_LITTLE_ENDIAN)
|
||||
PIPE_ENDIAN_NATIVE = PIPE_ENDIAN_LITTLE
|
||||
#elif defined(PIPE_ARCH_BIG_ENDIAN)
|
||||
PIPE_ENDIAN_NATIVE = PIPE_ENDIAN_BIG
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* Implementation limits which are queried through
|
||||
|
@@ -239,8 +239,12 @@ struct st_visual
|
||||
*/
|
||||
struct st_config_options
|
||||
{
|
||||
boolean force_glsl_extensions_warn;
|
||||
boolean disable_glsl_line_continuations;
|
||||
boolean disable_blend_func_extended;
|
||||
boolean disable_glsl_line_continuations;
|
||||
boolean disable_shader_bit_encoding;
|
||||
boolean force_glsl_extensions_warn;
|
||||
unsigned force_glsl_version;
|
||||
boolean force_s3tc_enable;
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -192,7 +192,8 @@ clGetDeviceInfo(cl_device_id dev, cl_device_info param,
|
||||
return scalar_property<size_t>(buf, size, size_ret, 0);
|
||||
|
||||
case CL_DEVICE_ENDIAN_LITTLE:
|
||||
return scalar_property<cl_bool>(buf, size, size_ret, CL_TRUE);
|
||||
return scalar_property<cl_bool>(buf, size, size_ret,
|
||||
dev->endianness() == PIPE_ENDIAN_LITTLE);
|
||||
|
||||
case CL_DEVICE_AVAILABLE:
|
||||
case CL_DEVICE_COMPILER_AVAILABLE:
|
||||
|
@@ -192,3 +192,8 @@ _cl_device_id::ir_target() const {
|
||||
PIPE_COMPUTE_CAP_IR_TARGET);
|
||||
return { target.data() };
|
||||
}
|
||||
|
||||
enum pipe_endian
|
||||
_cl_device_id::endianness() const {
|
||||
return (enum pipe_endian)pipe->get_param(pipe, PIPE_CAP_ENDIANNESS);
|
||||
}
|
||||
|
@@ -66,6 +66,7 @@ public:
|
||||
std::string vendor_name() const;
|
||||
enum pipe_shader_ir ir_format() const;
|
||||
std::string ir_target() const;
|
||||
enum pipe_endian endianness() const;
|
||||
|
||||
friend struct _cl_command_queue;
|
||||
friend class clover::root_resource;
|
||||
|
@@ -22,31 +22,32 @@
|
||||
|
||||
#include "core/kernel.hpp"
|
||||
#include "core/resource.hpp"
|
||||
#include "util/u_math.h"
|
||||
#include "pipe/p_context.h"
|
||||
|
||||
using namespace clover;
|
||||
|
||||
_cl_kernel::_cl_kernel(clover::program &prog,
|
||||
const std::string &name,
|
||||
const std::vector<clover::module::argument> &args) :
|
||||
const std::vector<clover::module::argument> &margs) :
|
||||
prog(prog), __name(name), exec(*this) {
|
||||
for (auto arg : args) {
|
||||
if (arg.type == module::argument::scalar)
|
||||
this->args.emplace_back(new scalar_argument(arg.size));
|
||||
else if (arg.type == module::argument::global)
|
||||
this->args.emplace_back(new global_argument(arg.size));
|
||||
else if (arg.type == module::argument::local)
|
||||
this->args.emplace_back(new local_argument());
|
||||
else if (arg.type == module::argument::constant)
|
||||
this->args.emplace_back(new constant_argument());
|
||||
else if (arg.type == module::argument::image2d_rd ||
|
||||
arg.type == module::argument::image3d_rd)
|
||||
this->args.emplace_back(new image_rd_argument());
|
||||
else if (arg.type == module::argument::image2d_wr ||
|
||||
arg.type == module::argument::image3d_wr)
|
||||
this->args.emplace_back(new image_wr_argument());
|
||||
else if (arg.type == module::argument::sampler)
|
||||
this->args.emplace_back(new sampler_argument());
|
||||
for (auto marg : margs) {
|
||||
if (marg.type == module::argument::scalar)
|
||||
args.emplace_back(new scalar_argument(marg.size));
|
||||
else if (marg.type == module::argument::global)
|
||||
args.emplace_back(new global_argument);
|
||||
else if (marg.type == module::argument::local)
|
||||
args.emplace_back(new local_argument);
|
||||
else if (marg.type == module::argument::constant)
|
||||
args.emplace_back(new constant_argument);
|
||||
else if (marg.type == module::argument::image2d_rd ||
|
||||
marg.type == module::argument::image3d_rd)
|
||||
args.emplace_back(new image_rd_argument);
|
||||
else if (marg.type == module::argument::image2d_wr ||
|
||||
marg.type == module::argument::image3d_wr)
|
||||
args.emplace_back(new image_wr_argument);
|
||||
else if (marg.type == module::argument::sampler)
|
||||
args.emplace_back(new sampler_argument);
|
||||
else
|
||||
throw error(CL_INVALID_KERNEL_DEFINITION);
|
||||
}
|
||||
@@ -129,7 +130,6 @@ _cl_kernel::module(const clover::command_queue &q) const {
|
||||
return prog.binaries().find(&q.dev)->second;
|
||||
}
|
||||
|
||||
|
||||
_cl_kernel::exec_context::exec_context(clover::kernel &kern) :
|
||||
kern(kern), q(NULL), mem_local(0), st(NULL) {
|
||||
}
|
||||
@@ -143,8 +143,12 @@ void *
|
||||
_cl_kernel::exec_context::bind(clover::command_queue *__q) {
|
||||
std::swap(q, __q);
|
||||
|
||||
for (auto &arg : kern.args)
|
||||
arg->bind(*this);
|
||||
// Bind kernel arguments.
|
||||
auto margs = kern.module(*q).sym(kern.name()).args;
|
||||
for_each([=](std::unique_ptr<kernel::argument> &karg,
|
||||
const module::argument &marg) {
|
||||
karg->bind(*this, marg);
|
||||
}, kern.args.begin(), kern.args.end(), margs.begin());
|
||||
|
||||
// Create a new compute state if anything changed.
|
||||
if (!st || q != __q ||
|
||||
@@ -176,8 +180,83 @@ _cl_kernel::exec_context::unbind() {
|
||||
mem_local = 0;
|
||||
}
|
||||
|
||||
_cl_kernel::argument::argument(size_t size) :
|
||||
__size(size), __set(false) {
|
||||
namespace {
|
||||
template<typename T>
|
||||
std::vector<uint8_t>
|
||||
bytes(const T& x) {
|
||||
return { (uint8_t *)&x, (uint8_t *)&x + sizeof(x) };
|
||||
}
|
||||
|
||||
///
|
||||
/// Transform buffer \a v from the native byte order into the byte
|
||||
/// order specified by \a e.
|
||||
///
|
||||
template<typename T>
|
||||
void
|
||||
byteswap(T &v, pipe_endian e) {
|
||||
if (PIPE_ENDIAN_NATIVE != e)
|
||||
std::reverse(v.begin(), v.end());
|
||||
}
|
||||
|
||||
///
|
||||
/// Pad buffer \a v to the next multiple of \a n.
|
||||
///
|
||||
template<typename T>
|
||||
void
|
||||
align(T &v, size_t n) {
|
||||
v.resize(util_align_npot(v.size(), n));
|
||||
}
|
||||
|
||||
bool
|
||||
msb(const std::vector<uint8_t> &s) {
|
||||
if (PIPE_ENDIAN_NATIVE == PIPE_ENDIAN_LITTLE)
|
||||
return s.back() & 0x80;
|
||||
else
|
||||
return s.front() & 0x80;
|
||||
}
|
||||
|
||||
///
|
||||
/// Resize buffer \a v to size \a n using sign or zero extension
|
||||
/// according to \a ext.
|
||||
///
|
||||
template<typename T>
|
||||
void
|
||||
extend(T &v, enum clover::module::argument::ext_type ext, size_t n) {
|
||||
const size_t m = std::min(v.size(), n);
|
||||
const bool sign_ext = (ext == module::argument::sign_ext);
|
||||
const uint8_t fill = (sign_ext && msb(v) ? ~0 : 0);
|
||||
T w(n, fill);
|
||||
|
||||
if (PIPE_ENDIAN_NATIVE == PIPE_ENDIAN_LITTLE)
|
||||
std::copy_n(v.begin(), m, w.begin());
|
||||
else
|
||||
std::copy_n(v.end() - m, m, w.end() - m);
|
||||
|
||||
std::swap(v, w);
|
||||
}
|
||||
|
||||
///
|
||||
/// Append buffer \a w to \a v.
|
||||
///
|
||||
template<typename T>
|
||||
void
|
||||
insert(T &v, const T &w) {
|
||||
v.insert(v.end(), w.begin(), w.end());
|
||||
}
|
||||
|
||||
///
|
||||
/// Append \a n elements to the end of buffer \a v.
|
||||
///
|
||||
template<typename T>
|
||||
size_t
|
||||
allocate(T &v, size_t n) {
|
||||
size_t pos = v.size();
|
||||
v.resize(pos + n);
|
||||
return pos;
|
||||
}
|
||||
}
|
||||
|
||||
_cl_kernel::argument::argument() : __set(false) {
|
||||
}
|
||||
|
||||
bool
|
||||
@@ -190,13 +269,12 @@ _cl_kernel::argument::storage() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
_cl_kernel::scalar_argument::scalar_argument(size_t size) :
|
||||
argument(size) {
|
||||
_cl_kernel::scalar_argument::scalar_argument(size_t size) : size(size) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::scalar_argument::set(size_t size, const void *value) {
|
||||
if (size != __size)
|
||||
if (size != this->size)
|
||||
throw error(CL_INVALID_ARG_SIZE);
|
||||
|
||||
v = { (uint8_t *)value, (uint8_t *)value + size };
|
||||
@@ -204,18 +282,20 @@ _cl_kernel::scalar_argument::set(size_t size, const void *value) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::scalar_argument::bind(exec_context &ctx) {
|
||||
ctx.input.insert(ctx.input.end(), v.begin(), v.end());
|
||||
_cl_kernel::scalar_argument::bind(exec_context &ctx,
|
||||
const clover::module::argument &marg) {
|
||||
auto w = v;
|
||||
|
||||
extend(w, marg.ext_type, marg.target_size);
|
||||
byteswap(w, ctx.q->dev.endianness());
|
||||
align(ctx.input, marg.target_align);
|
||||
insert(ctx.input, w);
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::scalar_argument::unbind(exec_context &ctx) {
|
||||
}
|
||||
|
||||
_cl_kernel::global_argument::global_argument(size_t size) :
|
||||
argument(size) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::global_argument::set(size_t size, const void *value) {
|
||||
if (size != sizeof(cl_mem))
|
||||
@@ -229,27 +309,17 @@ _cl_kernel::global_argument::set(size_t size, const void *value) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::global_argument::bind(exec_context &ctx) {
|
||||
size_t offset = ctx.input.size();
|
||||
size_t idx = ctx.g_buffers.size();
|
||||
|
||||
ctx.input.resize(offset + __size);
|
||||
|
||||
ctx.g_buffers.resize(idx + 1);
|
||||
ctx.g_buffers[idx] = obj->resource(ctx.q).pipe;
|
||||
|
||||
ctx.g_handles.resize(idx + 1);
|
||||
ctx.g_handles[idx] = offset;
|
||||
_cl_kernel::global_argument::bind(exec_context &ctx,
|
||||
const clover::module::argument &marg) {
|
||||
align(ctx.input, marg.target_align);
|
||||
ctx.g_handles.push_back(allocate(ctx.input, marg.target_size));
|
||||
ctx.g_buffers.push_back(obj->resource(ctx.q).pipe);
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::global_argument::unbind(exec_context &ctx) {
|
||||
}
|
||||
|
||||
_cl_kernel::local_argument::local_argument() :
|
||||
argument(sizeof(uint32_t)) {
|
||||
}
|
||||
|
||||
size_t
|
||||
_cl_kernel::local_argument::storage() const {
|
||||
return __storage;
|
||||
@@ -265,12 +335,14 @@ _cl_kernel::local_argument::set(size_t size, const void *value) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::local_argument::bind(exec_context &ctx) {
|
||||
size_t offset = ctx.input.size();
|
||||
size_t ptr = ctx.mem_local;
|
||||
_cl_kernel::local_argument::bind(exec_context &ctx,
|
||||
const clover::module::argument &marg) {
|
||||
auto v = bytes(ctx.mem_local);
|
||||
|
||||
ctx.input.resize(offset + sizeof(uint32_t));
|
||||
*(uint32_t *)&ctx.input[offset] = ptr;
|
||||
extend(v, module::argument::zero_ext, marg.target_size);
|
||||
byteswap(v, ctx.q->dev.endianness());
|
||||
align(ctx.input, marg.target_align);
|
||||
insert(ctx.input, v);
|
||||
|
||||
ctx.mem_local += __storage;
|
||||
}
|
||||
@@ -279,10 +351,6 @@ void
|
||||
_cl_kernel::local_argument::unbind(exec_context &ctx) {
|
||||
}
|
||||
|
||||
_cl_kernel::constant_argument::constant_argument() :
|
||||
argument(sizeof(uint32_t)) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::constant_argument::set(size_t size, const void *value) {
|
||||
if (size != sizeof(cl_mem))
|
||||
@@ -296,15 +364,17 @@ _cl_kernel::constant_argument::set(size_t size, const void *value) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::constant_argument::bind(exec_context &ctx) {
|
||||
size_t offset = ctx.input.size();
|
||||
size_t idx = ctx.resources.size();
|
||||
_cl_kernel::constant_argument::bind(exec_context &ctx,
|
||||
const clover::module::argument &marg) {
|
||||
auto v = bytes(ctx.resources.size() << 24);
|
||||
|
||||
ctx.input.resize(offset + sizeof(uint32_t));
|
||||
*(uint32_t *)&ctx.input[offset] = idx << 24;
|
||||
extend(v, module::argument::zero_ext, marg.target_size);
|
||||
byteswap(v, ctx.q->dev.endianness());
|
||||
align(ctx.input, marg.target_align);
|
||||
insert(ctx.input, v);
|
||||
|
||||
ctx.resources.resize(idx + 1);
|
||||
ctx.resources[idx] = st = obj->resource(ctx.q).bind_surface(*ctx.q, false);
|
||||
st = obj->resource(ctx.q).bind_surface(*ctx.q, false);
|
||||
ctx.resources.push_back(st);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -312,10 +382,6 @@ _cl_kernel::constant_argument::unbind(exec_context &ctx) {
|
||||
obj->resource(ctx.q).unbind_surface(*ctx.q, st);
|
||||
}
|
||||
|
||||
_cl_kernel::image_rd_argument::image_rd_argument() :
|
||||
argument(sizeof(uint32_t)) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::image_rd_argument::set(size_t size, const void *value) {
|
||||
if (size != sizeof(cl_mem))
|
||||
@@ -329,15 +395,17 @@ _cl_kernel::image_rd_argument::set(size_t size, const void *value) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::image_rd_argument::bind(exec_context &ctx) {
|
||||
size_t offset = ctx.input.size();
|
||||
size_t idx = ctx.sviews.size();
|
||||
_cl_kernel::image_rd_argument::bind(exec_context &ctx,
|
||||
const clover::module::argument &marg) {
|
||||
auto v = bytes(ctx.sviews.size());
|
||||
|
||||
ctx.input.resize(offset + sizeof(uint32_t));
|
||||
*(uint32_t *)&ctx.input[offset] = idx;
|
||||
extend(v, module::argument::zero_ext, marg.target_size);
|
||||
byteswap(v, ctx.q->dev.endianness());
|
||||
align(ctx.input, marg.target_align);
|
||||
insert(ctx.input, v);
|
||||
|
||||
ctx.sviews.resize(idx + 1);
|
||||
ctx.sviews[idx] = st = obj->resource(ctx.q).bind_sampler_view(*ctx.q);
|
||||
st = obj->resource(ctx.q).bind_sampler_view(*ctx.q);
|
||||
ctx.sviews.push_back(st);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -345,10 +413,6 @@ _cl_kernel::image_rd_argument::unbind(exec_context &ctx) {
|
||||
obj->resource(ctx.q).unbind_sampler_view(*ctx.q, st);
|
||||
}
|
||||
|
||||
_cl_kernel::image_wr_argument::image_wr_argument() :
|
||||
argument(sizeof(uint32_t)) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::image_wr_argument::set(size_t size, const void *value) {
|
||||
if (size != sizeof(cl_mem))
|
||||
@@ -362,15 +426,17 @@ _cl_kernel::image_wr_argument::set(size_t size, const void *value) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::image_wr_argument::bind(exec_context &ctx) {
|
||||
size_t offset = ctx.input.size();
|
||||
size_t idx = ctx.resources.size();
|
||||
_cl_kernel::image_wr_argument::bind(exec_context &ctx,
|
||||
const clover::module::argument &marg) {
|
||||
auto v = bytes(ctx.resources.size());
|
||||
|
||||
ctx.input.resize(offset + sizeof(uint32_t));
|
||||
*(uint32_t *)&ctx.input[offset] = idx;
|
||||
extend(v, module::argument::zero_ext, marg.target_size);
|
||||
byteswap(v, ctx.q->dev.endianness());
|
||||
align(ctx.input, marg.target_align);
|
||||
insert(ctx.input, v);
|
||||
|
||||
ctx.resources.resize(idx + 1);
|
||||
ctx.resources[idx] = st = obj->resource(ctx.q).bind_surface(*ctx.q, true);
|
||||
st = obj->resource(ctx.q).bind_surface(*ctx.q, true);
|
||||
ctx.resources.push_back(st);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -378,10 +444,6 @@ _cl_kernel::image_wr_argument::unbind(exec_context &ctx) {
|
||||
obj->resource(ctx.q).unbind_surface(*ctx.q, st);
|
||||
}
|
||||
|
||||
_cl_kernel::sampler_argument::sampler_argument() :
|
||||
argument(0) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::sampler_argument::set(size_t size, const void *value) {
|
||||
if (size != sizeof(cl_sampler))
|
||||
@@ -392,11 +454,10 @@ _cl_kernel::sampler_argument::set(size_t size, const void *value) {
|
||||
}
|
||||
|
||||
void
|
||||
_cl_kernel::sampler_argument::bind(exec_context &ctx) {
|
||||
size_t idx = ctx.samplers.size();
|
||||
|
||||
ctx.samplers.resize(idx + 1);
|
||||
ctx.samplers[idx] = st = obj->bind(*ctx.q);
|
||||
_cl_kernel::sampler_argument::bind(exec_context &ctx,
|
||||
const clover::module::argument &marg) {
|
||||
st = obj->bind(*ctx.q);
|
||||
ctx.samplers.push_back(st);
|
||||
}
|
||||
|
||||
void
|
||||
|
@@ -68,14 +68,11 @@ private:
|
||||
public:
|
||||
class argument {
|
||||
public:
|
||||
argument(size_t size);
|
||||
argument();
|
||||
|
||||
/// \a true if the argument has been set.
|
||||
bool set() const;
|
||||
|
||||
/// Argument size in the input buffer.
|
||||
size_t size() const;
|
||||
|
||||
/// Storage space required for the referenced object.
|
||||
virtual size_t storage() const;
|
||||
|
||||
@@ -84,19 +81,19 @@ public:
|
||||
|
||||
/// Allocate the necessary resources to bind the specified
|
||||
/// object to this argument, and update \a ctx accordingly.
|
||||
virtual void bind(exec_context &ctx) = 0;
|
||||
virtual void bind(exec_context &ctx,
|
||||
const clover::module::argument &marg) = 0;
|
||||
|
||||
/// Free any resources that were allocated in bind().
|
||||
virtual void unbind(exec_context &ctx) = 0;
|
||||
|
||||
protected:
|
||||
size_t __size;
|
||||
bool __set;
|
||||
};
|
||||
|
||||
_cl_kernel(clover::program &prog,
|
||||
const std::string &name,
|
||||
const std::vector<clover::module::argument> &args);
|
||||
const std::vector<clover::module::argument> &margs);
|
||||
|
||||
void launch(clover::command_queue &q,
|
||||
const std::vector<size_t> &grid_offset,
|
||||
@@ -122,19 +119,20 @@ private:
|
||||
scalar_argument(size_t size);
|
||||
|
||||
virtual void set(size_t size, const void *value);
|
||||
virtual void bind(exec_context &ctx);
|
||||
virtual void bind(exec_context &ctx,
|
||||
const clover::module::argument &marg);
|
||||
virtual void unbind(exec_context &ctx);
|
||||
|
||||
private:
|
||||
size_t size;
|
||||
std::vector<uint8_t> v;
|
||||
};
|
||||
|
||||
class global_argument : public argument {
|
||||
public:
|
||||
global_argument(size_t size);
|
||||
|
||||
virtual void set(size_t size, const void *value);
|
||||
virtual void bind(exec_context &ctx);
|
||||
virtual void bind(exec_context &ctx,
|
||||
const clover::module::argument &marg);
|
||||
virtual void unbind(exec_context &ctx);
|
||||
|
||||
private:
|
||||
@@ -143,12 +141,11 @@ private:
|
||||
|
||||
class local_argument : public argument {
|
||||
public:
|
||||
local_argument();
|
||||
|
||||
virtual size_t storage() const;
|
||||
|
||||
virtual void set(size_t size, const void *value);
|
||||
virtual void bind(exec_context &ctx);
|
||||
virtual void bind(exec_context &ctx,
|
||||
const clover::module::argument &marg);
|
||||
virtual void unbind(exec_context &ctx);
|
||||
|
||||
private:
|
||||
@@ -157,10 +154,9 @@ private:
|
||||
|
||||
class constant_argument : public argument {
|
||||
public:
|
||||
constant_argument();
|
||||
|
||||
virtual void set(size_t size, const void *value);
|
||||
virtual void bind(exec_context &ctx);
|
||||
virtual void bind(exec_context &ctx,
|
||||
const clover::module::argument &marg);
|
||||
virtual void unbind(exec_context &ctx);
|
||||
|
||||
private:
|
||||
@@ -170,10 +166,9 @@ private:
|
||||
|
||||
class image_rd_argument : public argument {
|
||||
public:
|
||||
image_rd_argument();
|
||||
|
||||
virtual void set(size_t size, const void *value);
|
||||
virtual void bind(exec_context &ctx);
|
||||
virtual void bind(exec_context &ctx,
|
||||
const clover::module::argument &marg);
|
||||
virtual void unbind(exec_context &ctx);
|
||||
|
||||
private:
|
||||
@@ -183,10 +178,9 @@ private:
|
||||
|
||||
class image_wr_argument : public argument {
|
||||
public:
|
||||
image_wr_argument();
|
||||
|
||||
virtual void set(size_t size, const void *value);
|
||||
virtual void bind(exec_context &ctx);
|
||||
virtual void bind(exec_context &ctx,
|
||||
const clover::module::argument &marg);
|
||||
virtual void unbind(exec_context &ctx);
|
||||
|
||||
private:
|
||||
@@ -196,10 +190,9 @@ private:
|
||||
|
||||
class sampler_argument : public argument {
|
||||
public:
|
||||
sampler_argument();
|
||||
|
||||
virtual void set(size_t size, const void *value);
|
||||
virtual void bind(exec_context &ctx);
|
||||
virtual void bind(exec_context &ctx,
|
||||
const clover::module::argument &marg);
|
||||
virtual void unbind(exec_context &ctx);
|
||||
|
||||
private:
|
||||
|
@@ -68,11 +68,32 @@ namespace clover {
|
||||
sampler
|
||||
};
|
||||
|
||||
argument(enum type type, size_t size) : type(type), size(size) { }
|
||||
argument() : type(scalar), size(0) { }
|
||||
enum ext_type {
|
||||
zero_ext,
|
||||
sign_ext
|
||||
};
|
||||
|
||||
argument(enum type type, size_t size,
|
||||
size_t target_size, size_t target_align,
|
||||
enum ext_type ext_type) :
|
||||
type(type), size(size),
|
||||
target_size(target_size), target_align(target_align),
|
||||
ext_type(ext_type) { }
|
||||
|
||||
argument(enum type type, size_t size) :
|
||||
type(type), size(size),
|
||||
target_size(size), target_align(1),
|
||||
ext_type(zero_ext) { }
|
||||
|
||||
argument() : type(scalar), size(0),
|
||||
target_size(0), target_align(1),
|
||||
ext_type(zero_ext) { }
|
||||
|
||||
type type;
|
||||
size_t size;
|
||||
size_t target_size;
|
||||
size_t target_align;
|
||||
ext_type ext_type;
|
||||
};
|
||||
|
||||
struct symbol {
|
||||
|
@@ -304,14 +304,21 @@ namespace {
|
||||
for (llvm::Function::arg_iterator I = kernel_func->arg_begin(),
|
||||
E = kernel_func->arg_end(); I != E; ++I) {
|
||||
llvm::Argument &arg = *I;
|
||||
llvm::Type *arg_type = arg.getType();
|
||||
#if HAVE_LLVM < 0x0302
|
||||
llvm::TargetData TD(kernel_func->getParent());
|
||||
#else
|
||||
llvm::DataLayout TD(kernel_func->getParent()->getDataLayout());
|
||||
#endif
|
||||
|
||||
llvm::Type *arg_type = arg.getType();
|
||||
unsigned arg_size = TD.getTypeStoreSize(arg_type);
|
||||
|
||||
llvm::Type *target_type = arg_type->isIntegerTy() ?
|
||||
TD.getSmallestLegalIntType(mod->getContext(), arg_size * 8) :
|
||||
arg_type;
|
||||
unsigned target_size = TD.getTypeStoreSize(target_type);
|
||||
unsigned target_align = TD.getABITypeAlignment(target_type);
|
||||
|
||||
if (llvm::isa<llvm::PointerType>(arg_type) && arg.hasByValAttr()) {
|
||||
arg_type =
|
||||
llvm::dyn_cast<llvm::PointerType>(arg_type)->getElementType();
|
||||
@@ -324,11 +331,24 @@ namespace {
|
||||
unsigned address_space = llvm::cast<llvm::PointerType>(arg_type)->getAddressSpace();
|
||||
switch (address_space) {
|
||||
default:
|
||||
args.push_back(module::argument(module::argument::global, arg_size));
|
||||
args.push_back(
|
||||
module::argument(module::argument::global, arg_size,
|
||||
target_size, target_align,
|
||||
module::argument::zero_ext));
|
||||
break;
|
||||
}
|
||||
|
||||
} else {
|
||||
args.push_back(module::argument(module::argument::scalar, arg_size));
|
||||
llvm::AttributeSet attrs = kernel_func->getAttributes();
|
||||
enum module::argument::ext_type ext_type =
|
||||
(attrs.hasAttribute(arg.getArgNo() + 1,
|
||||
llvm::Attribute::SExt) ?
|
||||
module::argument::sign_ext :
|
||||
module::argument::zero_ext);
|
||||
|
||||
args.push_back(
|
||||
module::argument(module::argument::scalar, arg_size,
|
||||
target_size, target_align, ext_type));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -52,10 +52,18 @@ dri_pp_query(struct dri_context *ctx)
|
||||
static void dri_fill_st_options(struct st_config_options *options,
|
||||
const struct driOptionCache * optionCache)
|
||||
{
|
||||
options->force_glsl_extensions_warn =
|
||||
driQueryOptionb(optionCache, "force_glsl_extensions_warn");
|
||||
options->disable_blend_func_extended =
|
||||
driQueryOptionb(optionCache, "disable_blend_func_extended");
|
||||
options->disable_glsl_line_continuations =
|
||||
driQueryOptionb(optionCache, "disable_glsl_line_continuations");
|
||||
options->disable_shader_bit_encoding =
|
||||
driQueryOptionb(optionCache, "disable_shader_bit_encoding");
|
||||
options->force_glsl_extensions_warn =
|
||||
driQueryOptionb(optionCache, "force_glsl_extensions_warn");
|
||||
options->force_glsl_version =
|
||||
driQueryOptioni(optionCache, "force_glsl_version");
|
||||
options->force_s3tc_enable =
|
||||
driQueryOptionb(optionCache, "force_s3tc_enable");
|
||||
}
|
||||
|
||||
GLboolean
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#include "state_tracker/drm_driver.h"
|
||||
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_format_s3tc.h"
|
||||
|
||||
#define MSAA_VISUAL_MAX_SAMPLES 32
|
||||
|
||||
@@ -48,14 +49,8 @@
|
||||
|
||||
PUBLIC const char __driConfigOptions[] =
|
||||
DRI_CONF_BEGIN
|
||||
DRI_CONF_SECTION_PERFORMANCE
|
||||
DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
|
||||
DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
|
||||
DRI_CONF_SECTION_END
|
||||
|
||||
DRI_CONF_SECTION_QUALITY
|
||||
/* DRI_CONF_FORCE_S3TC_ENABLE("false") */
|
||||
DRI_CONF_ALLOW_LARGE_TEXTURES(1)
|
||||
DRI_CONF_FORCE_S3TC_ENABLE("false")
|
||||
DRI_CONF_PP_CELSHADE(0)
|
||||
DRI_CONF_PP_NORED(0)
|
||||
DRI_CONF_PP_NOGREEN(0)
|
||||
@@ -67,6 +62,9 @@ PUBLIC const char __driConfigOptions[] =
|
||||
DRI_CONF_SECTION_DEBUG
|
||||
DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN("false")
|
||||
DRI_CONF_DISABLE_GLSL_LINE_CONTINUATIONS("false")
|
||||
DRI_CONF_DISABLE_BLEND_FUNC_EXTENDED("false")
|
||||
DRI_CONF_DISABLE_SHADER_BIT_ENCODING("false")
|
||||
DRI_CONF_FORCE_GLSL_VERSION(0)
|
||||
DRI_CONF_SECTION_END
|
||||
|
||||
DRI_CONF_SECTION_MISCELLANEOUS
|
||||
@@ -76,7 +74,7 @@ PUBLIC const char __driConfigOptions[] =
|
||||
|
||||
#define false 0
|
||||
|
||||
static const uint __driNConfigOptions = 12;
|
||||
static const uint __driNConfigOptions = 13;
|
||||
|
||||
static const __DRIconfig **
|
||||
dri_fill_in_modes(struct dri_screen *screen)
|
||||
@@ -416,6 +414,20 @@ dri_init_screen_helper(struct dri_screen *screen,
|
||||
screen->sPriv->myNum,
|
||||
driver_descriptor.name);
|
||||
|
||||
/* Handle force_s3tc_enable. */
|
||||
if (!util_format_s3tc_enabled &&
|
||||
driQueryOptionb(&screen->optionCache, "force_s3tc_enable")) {
|
||||
/* Ensure libtxc_dxtn has been loaded if available.
|
||||
* Forcing S3TC on before calling this would prevent loading
|
||||
* the library.
|
||||
* This is just a precaution, the driver should have called it
|
||||
* already.
|
||||
*/
|
||||
util_format_s3tc_init();
|
||||
|
||||
util_format_s3tc_enabled = TRUE;
|
||||
}
|
||||
|
||||
return dri_fill_in_modes(screen);
|
||||
}
|
||||
|
||||
|
@@ -543,6 +543,11 @@ OSMesaCreateContextExt(GLenum format, GLint depthBits, GLint stencilBits,
|
||||
attribs.minor = 1;
|
||||
attribs.flags = 0; /* ST_CONTEXT_FLAG_x */
|
||||
attribs.options.force_glsl_extensions_warn = FALSE;
|
||||
attribs.options.disable_blend_func_extended = FALSE;
|
||||
attribs.options.disable_glsl_line_continuations = FALSE;
|
||||
attribs.options.disable_shader_bit_encoding = FALSE;
|
||||
attribs.options.force_s3tc_enable = FALSE;
|
||||
attribs.options.force_glsl_version = 0;
|
||||
|
||||
osmesa_init_st_visual(&attribs.visual,
|
||||
PIPE_FORMAT_R8G8B8A8_UNORM,
|
||||
|
@@ -404,7 +404,7 @@ static boolean do_winsys_init(struct radeon_drm_winsys *ws)
|
||||
&ws->info.r600_ib_vm_max_size))
|
||||
ws->info.r600_virtual_address = FALSE;
|
||||
}
|
||||
if (ws->gen == DRV_R600 && !debug_get_bool_option("RADEON_VA", TRUE))
|
||||
if (ws->gen == DRV_R600 && !debug_get_bool_option("RADEON_VA", FALSE))
|
||||
ws->info.r600_virtual_address = FALSE;
|
||||
}
|
||||
|
||||
|
@@ -24,6 +24,7 @@ libgbm_la_LIBADD = $(LIBUDEV_LIBS) $(LIBKMS_LIBS) $(DLOPEN_LIBS)
|
||||
if HAVE_EGL_PLATFORM_WAYLAND
|
||||
AM_CPPFLAGS = -DHAVE_WAYLAND_PLATFORM
|
||||
AM_CFLAGS += $(WAYLAND_CFLAGS)
|
||||
libgbm_la_LIBADD += $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la $(WAYLAND_LIBS)
|
||||
endif
|
||||
|
||||
if HAVE_DRI
|
||||
@@ -38,7 +39,7 @@ libgbm_dri_la_CFLAGS = \
|
||||
$(LIBDRM_CFLAGS)
|
||||
|
||||
libgbm_la_LIBADD += \
|
||||
libgbm_dri.la $(top_builddir)/src/mapi/shared-glapi/libglapi.la
|
||||
libgbm_dri.la $(top_builddir)/src/mapi/shared-glapi/libglapi.la $(LIBDRM_LIBS)
|
||||
endif
|
||||
|
||||
all-local: libgbm.la
|
||||
|
@@ -1771,12 +1771,6 @@ process_array_type(YYLTYPE *loc, const glsl_type *base, ast_node *array_size,
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (state->es_shader) {
|
||||
/* Section 10.17 of the GLSL ES 1.00 specification states that unsized
|
||||
* array declarations have been removed from the language.
|
||||
*/
|
||||
_mesa_glsl_error(loc, state, "unsized array declarations are not "
|
||||
"allowed in GLSL ES 1.00.");
|
||||
}
|
||||
|
||||
const glsl_type *array_type = glsl_type::get_array_instance(base, length);
|
||||
@@ -1963,6 +1957,21 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
|
||||
_mesa_glsl_shader_target_name(state->target));
|
||||
}
|
||||
|
||||
/* Section 6.1.1 (Function Calling Conventions) of the GLSL 1.10 spec says:
|
||||
*
|
||||
* "However, the const qualifier cannot be used with out or inout."
|
||||
*
|
||||
* The same section of the GLSL 4.40 spec further clarifies this saying:
|
||||
*
|
||||
* "The const qualifier cannot be used with out or inout, or a
|
||||
* compile-time error results."
|
||||
*/
|
||||
if (is_parameter && qual->flags.q.constant && qual->flags.q.out) {
|
||||
_mesa_glsl_error(loc, state,
|
||||
"`const' may not be applied to `out' or `inout' "
|
||||
"function parameters");
|
||||
}
|
||||
|
||||
/* If there is no qualifier that changes the mode of the variable, leave
|
||||
* the setting alone.
|
||||
*/
|
||||
@@ -2605,6 +2614,11 @@ ast_declarator_list::hir(exec_list *instructions,
|
||||
* name of a known structure type. This is both invalid and weird.
|
||||
* Emit an error.
|
||||
*
|
||||
* - The program text contained something like 'mediump float;'
|
||||
* when the programmer probably meant 'precision mediump
|
||||
* float;' Emit a warning with a description of what they
|
||||
* probably meant to do.
|
||||
*
|
||||
* Note that if decl_type is NULL and there is a structure involved,
|
||||
* there must have been some sort of error with the structure. In this
|
||||
* case we assume that an error was already generated on this line of
|
||||
@@ -2613,20 +2627,33 @@ ast_declarator_list::hir(exec_list *instructions,
|
||||
*/
|
||||
assert(this->type->specifier->structure == NULL || decl_type != NULL
|
||||
|| state->error);
|
||||
if (this->type->specifier->structure == NULL) {
|
||||
if (decl_type != NULL) {
|
||||
_mesa_glsl_warning(&loc, state, "empty declaration");
|
||||
} else {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"invalid type `%s' in empty declaration",
|
||||
type_name);
|
||||
}
|
||||
}
|
||||
|
||||
if (this->type->qualifier.precision != ast_precision_none &&
|
||||
this->type->specifier->structure != NULL) {
|
||||
_mesa_glsl_error(&loc, state, "Precision qualifiers can't be applied "
|
||||
"to structures.\n");
|
||||
if (decl_type == NULL) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"invalid type `%s' in empty declaration",
|
||||
type_name);
|
||||
} else if (this->type->qualifier.precision != ast_precision_none) {
|
||||
if (this->type->specifier->structure != NULL) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"precision qualifiers can't be applied "
|
||||
"to structures");
|
||||
} else {
|
||||
static const char *const precision_names[] = {
|
||||
"highp",
|
||||
"highp",
|
||||
"mediump",
|
||||
"lowp"
|
||||
};
|
||||
|
||||
_mesa_glsl_warning(&loc, state,
|
||||
"empty declaration with precision qualifier, "
|
||||
"to set the default precision, use "
|
||||
"`precision %s %s;'",
|
||||
precision_names[this->type->qualifier.precision],
|
||||
type_name);
|
||||
}
|
||||
} else {
|
||||
_mesa_glsl_warning(&loc, state, "empty declaration");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2927,6 +2954,20 @@ ast_declarator_list::hir(exec_list *instructions,
|
||||
"'centroid in' cannot be used in a vertex shader");
|
||||
}
|
||||
|
||||
/* Section 4.3.6 of the GLSL 1.30 specification states:
|
||||
* "It is an error to use centroid out in a fragment shader."
|
||||
*
|
||||
* The GL_ARB_shading_language_420pack extension specification states:
|
||||
* "It is an error to use auxiliary storage qualifiers or interpolation
|
||||
* qualifiers on an output in a fragment shader."
|
||||
*/
|
||||
if (state->target == fragment_shader &&
|
||||
this->type->qualifier.flags.q.out &&
|
||||
this->type->qualifier.has_auxiliary_storage()) {
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"auxiliary storage qualifiers cannot be used on "
|
||||
"fragment shader outputs");
|
||||
}
|
||||
|
||||
/* Precision qualifiers exists only in GLSL versions 1.00 and >= 1.30.
|
||||
*/
|
||||
@@ -3001,6 +3042,33 @@ ast_declarator_list::hir(exec_list *instructions,
|
||||
decl->identifier);
|
||||
}
|
||||
|
||||
if (state->es_shader) {
|
||||
const glsl_type *const t = (earlier == NULL)
|
||||
? var->type : earlier->type;
|
||||
|
||||
if (t->is_array() && t->length == 0)
|
||||
/* Section 10.17 of the GLSL ES 1.00 specification states that
|
||||
* unsized array declarations have been removed from the language.
|
||||
* Arrays that are sized using an initializer are still explicitly
|
||||
* sized. However, GLSL ES 1.00 does not allow array
|
||||
* initializers. That is only allowed in GLSL ES 3.00.
|
||||
*
|
||||
* Section 4.1.9 (Arrays) of the GLSL ES 3.00 spec says:
|
||||
*
|
||||
* "An array type can also be formed without specifying a size
|
||||
* if the definition includes an initializer:
|
||||
*
|
||||
* float x[] = float[2] (1.0, 2.0); // declares an array of size 2
|
||||
* float y[] = float[] (1.0, 2.0, 3.0); // declares an array of size 3
|
||||
*
|
||||
* float a[5];
|
||||
* float b[] = a;"
|
||||
*/
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"unsized array declarations are not allowed in "
|
||||
"GLSL ES");
|
||||
}
|
||||
|
||||
/* If the declaration is not a redeclaration, there are a few additional
|
||||
* semantic checks that must be applied. In addition, variable that was
|
||||
* created for the declaration should be added to the IR stream.
|
||||
@@ -3309,6 +3377,18 @@ ast_function::hir(exec_list *instructions,
|
||||
"function `%s' return type has qualifiers", name);
|
||||
}
|
||||
|
||||
/* Section 6.1 (Function Definitions) of the GLSL 1.20 spec says:
|
||||
*
|
||||
* "Arrays are allowed as arguments and as the return type. In both
|
||||
* cases, the array must be explicitly sized."
|
||||
*/
|
||||
if (return_type->is_array() && return_type->length == 0) {
|
||||
YYLTYPE loc = this->get_location();
|
||||
_mesa_glsl_error(& loc, state,
|
||||
"function `%s' return type array must be explicitly "
|
||||
"sized", name);
|
||||
}
|
||||
|
||||
/* From page 17 (page 23 of the PDF) of the GLSL 1.20 spec:
|
||||
*
|
||||
* "[Sampler types] can only be declared as function parameters
|
||||
@@ -4249,6 +4329,34 @@ ast_struct_specifier::hir(exec_list *instructions,
|
||||
struct _mesa_glsl_parse_state *state)
|
||||
{
|
||||
YYLTYPE loc = this->get_location();
|
||||
|
||||
/* Section 4.1.8 (Structures) of the GLSL 1.10 spec says:
|
||||
*
|
||||
* "Anonymous structures are not supported; so embedded structures must
|
||||
* have a declarator. A name given to an embedded struct is scoped at
|
||||
* the same level as the struct it is embedded in."
|
||||
*
|
||||
* The same section of the GLSL 1.20 spec says:
|
||||
*
|
||||
* "Anonymous structures are not supported. Embedded structures are not
|
||||
* supported.
|
||||
*
|
||||
* struct S { float f; };
|
||||
* struct T {
|
||||
* S; // Error: anonymous structures disallowed
|
||||
* struct { ... }; // Error: embedded structures disallowed
|
||||
* S s; // Okay: nested structures with name are allowed
|
||||
* };"
|
||||
*
|
||||
* The GLSL ES 1.00 and 3.00 specs have similar langauge and examples. So,
|
||||
* we allow embedded structures in 1.10 only.
|
||||
*/
|
||||
if (state->language_version != 110 && state->struct_specifier_depth != 0)
|
||||
_mesa_glsl_error(&loc, state,
|
||||
"embedded structure declartions are not allowed");
|
||||
|
||||
state->struct_specifier_depth++;
|
||||
|
||||
glsl_struct_field *fields;
|
||||
unsigned decl_count =
|
||||
ast_process_structure_or_interface_block(instructions,
|
||||
@@ -4275,6 +4383,8 @@ ast_struct_specifier::hir(exec_list *instructions,
|
||||
}
|
||||
}
|
||||
|
||||
state->struct_specifier_depth--;
|
||||
|
||||
/* Structure type definitions do not have r-values.
|
||||
*/
|
||||
return NULL;
|
||||
|
@@ -1,4 +1,6 @@
|
||||
#version 100
|
||||
precision highp float;
|
||||
|
||||
vec4 texture2D (sampler2D sampler, vec2 coord, float bias);
|
||||
vec4 texture2DProj (sampler2D sampler, vec3 coord, float bias);
|
||||
vec4 texture2DProj (sampler2D sampler, vec4 coord, float bias);
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#version 300 es
|
||||
precision highp float;
|
||||
|
||||
/* texture - bias variants */
|
||||
vec4 texture( sampler2D sampler, vec2 P, float bias);
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#version 100
|
||||
#extension GL_OES_EGL_image_external : enable
|
||||
precision highp float;
|
||||
|
||||
vec4 texture2D(samplerExternalOES sampler, vec2 coord);
|
||||
vec4 texture2DProj(samplerExternalOES sampler, vec3 coord);
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#version 100
|
||||
#extension GL_OES_standard_derivatives : enable
|
||||
precision highp float;
|
||||
|
||||
/*
|
||||
* 8.8 - Fragment Processing Functions
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#version 100
|
||||
#extension GL_OES_texture_3D : enable
|
||||
precision highp float;
|
||||
|
||||
vec4 texture3D (sampler3D sampler, vec3 coord);
|
||||
vec4 texture3DProj (sampler3D sampler, vec4 coord);
|
||||
|
@@ -149,7 +149,7 @@ literal_integer(char *text, int len, struct _mesa_glsl_parse_state *state,
|
||||
%option bison-bridge bison-locations reentrant noyywrap
|
||||
%option nounput noyy_top_state
|
||||
%option never-interactive
|
||||
%option prefix="_mesa_glsl_"
|
||||
%option prefix="_mesa_glsl_lexer_"
|
||||
%option extra-type="struct _mesa_glsl_parse_state *"
|
||||
|
||||
%x PP PRAGMA
|
||||
@@ -324,30 +324,11 @@ sampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multi
|
||||
isampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMSARRAY);
|
||||
usampler2DMSArray KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, USAMPLER2DMSARRAY);
|
||||
|
||||
samplerCubeArray {
|
||||
if (yyextra->ARB_texture_cube_map_array_enable)
|
||||
return SAMPLERCUBEARRAY;
|
||||
else
|
||||
return IDENTIFIER;
|
||||
}
|
||||
isamplerCubeArray {
|
||||
if (yyextra->ARB_texture_cube_map_array_enable)
|
||||
return ISAMPLERCUBEARRAY;
|
||||
else
|
||||
return IDENTIFIER;
|
||||
}
|
||||
usamplerCubeArray {
|
||||
if (yyextra->ARB_texture_cube_map_array_enable)
|
||||
return USAMPLERCUBEARRAY;
|
||||
else
|
||||
return IDENTIFIER;
|
||||
}
|
||||
samplerCubeArrayShadow {
|
||||
if (yyextra->ARB_texture_cube_map_array_enable)
|
||||
return SAMPLERCUBEARRAYSHADOW;
|
||||
else
|
||||
return IDENTIFIER;
|
||||
}
|
||||
/* keywords available with ARB_texture_cube_map_array_enable extension on desktop GLSL */
|
||||
samplerCubeArray KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAY);
|
||||
isamplerCubeArray KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, ISAMPLERCUBEARRAY);
|
||||
usamplerCubeArray KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, USAMPLERCUBEARRAY);
|
||||
samplerCubeArrayShadow KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAYSHADOW);
|
||||
|
||||
samplerExternalOES {
|
||||
if (yyextra->OES_EGL_image_external_enable)
|
||||
@@ -371,7 +352,7 @@ layout {
|
||||
return LAYOUT_TOK;
|
||||
} else {
|
||||
yylval->identifier = strdup(yytext);
|
||||
return IDENTIFIER;
|
||||
return classify_identifier(yyextra, yytext);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -31,14 +31,18 @@
|
||||
#include "glsl_types.h"
|
||||
#include "main/context.h"
|
||||
|
||||
#define YYLEX_PARAM state->scanner
|
||||
|
||||
#undef yyerror
|
||||
|
||||
static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg)
|
||||
{
|
||||
_mesa_glsl_error(loc, st, "%s", msg);
|
||||
}
|
||||
|
||||
static int
|
||||
_mesa_glsl_lex(YYSTYPE *val, YYLTYPE *loc, _mesa_glsl_parse_state *state)
|
||||
{
|
||||
return _mesa_glsl_lexer_lex(val, loc, state->scanner);
|
||||
}
|
||||
%}
|
||||
|
||||
%expect 0
|
||||
@@ -55,7 +59,7 @@ static void yyerror(YYLTYPE *loc, _mesa_glsl_parse_state *st, const char *msg)
|
||||
@$.source = 0;
|
||||
}
|
||||
|
||||
%lex-param {void *scanner}
|
||||
%lex-param {struct _mesa_glsl_parse_state *state}
|
||||
%parse-param {struct _mesa_glsl_parse_state *state}
|
||||
|
||||
%union {
|
||||
|
@@ -71,10 +71,12 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
|
||||
this->loop_nesting_ast = NULL;
|
||||
this->switch_state.switch_nesting_ast = NULL;
|
||||
|
||||
this->struct_specifier_depth = 0;
|
||||
this->num_builtins_to_link = 0;
|
||||
|
||||
/* Set default language version and extensions */
|
||||
this->language_version = 110;
|
||||
this->language_version = ctx->Const.ForceGLSLVersion ?
|
||||
ctx->Const.ForceGLSLVersion : 110;
|
||||
this->es_shader = false;
|
||||
this->ARB_texture_rectangle_enable = true;
|
||||
|
||||
|
@@ -158,6 +158,13 @@ struct _mesa_glsl_parse_state {
|
||||
unsigned language_version;
|
||||
enum _mesa_glsl_parser_targets target;
|
||||
|
||||
/**
|
||||
* Number of nested struct_specifier levels
|
||||
*
|
||||
* Outside a struct_specifer, this is zero.
|
||||
*/
|
||||
unsigned struct_specifier_depth;
|
||||
|
||||
/**
|
||||
* Default uniform layout qualifiers tracked during parsing.
|
||||
* Currently affects uniform blocks and uniform buffer variables in
|
||||
@@ -337,8 +344,8 @@ extern void _mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state,
|
||||
extern void _mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state);
|
||||
|
||||
union YYSTYPE;
|
||||
extern int _mesa_glsl_lex(union YYSTYPE *yylval, YYLTYPE *yylloc,
|
||||
void *scanner);
|
||||
extern int _mesa_glsl_lexer_lex(union YYSTYPE *yylval, YYLTYPE *yylloc,
|
||||
void *scanner);
|
||||
|
||||
extern int _mesa_glsl_parse(struct _mesa_glsl_parse_state *);
|
||||
|
||||
|
@@ -281,7 +281,7 @@ glsl_type::glsl_type(const glsl_type *array, unsigned length) :
|
||||
}
|
||||
|
||||
|
||||
const glsl_type *const
|
||||
const glsl_type *
|
||||
glsl_type::vec(unsigned components)
|
||||
{
|
||||
if (components == 0 || components > 4)
|
||||
@@ -294,7 +294,7 @@ glsl_type::vec(unsigned components)
|
||||
}
|
||||
|
||||
|
||||
const glsl_type *const
|
||||
const glsl_type *
|
||||
glsl_type::ivec(unsigned components)
|
||||
{
|
||||
if (components == 0 || components > 4)
|
||||
@@ -307,7 +307,7 @@ glsl_type::ivec(unsigned components)
|
||||
}
|
||||
|
||||
|
||||
const glsl_type *const
|
||||
const glsl_type *
|
||||
glsl_type::uvec(unsigned components)
|
||||
{
|
||||
if (components == 0 || components > 4)
|
||||
@@ -320,7 +320,7 @@ glsl_type::uvec(unsigned components)
|
||||
}
|
||||
|
||||
|
||||
const glsl_type *const
|
||||
const glsl_type *
|
||||
glsl_type::bvec(unsigned components)
|
||||
{
|
||||
if (components == 0 || components > 4)
|
||||
|
@@ -170,10 +170,10 @@ struct glsl_type {
|
||||
* Convenience accessors for vector types (shorter than get_instance()).
|
||||
* @{
|
||||
*/
|
||||
static const glsl_type *const vec(unsigned components);
|
||||
static const glsl_type *const ivec(unsigned components);
|
||||
static const glsl_type *const uvec(unsigned components);
|
||||
static const glsl_type *const bvec(unsigned components);
|
||||
static const glsl_type *vec(unsigned components);
|
||||
static const glsl_type *ivec(unsigned components);
|
||||
static const glsl_type *uvec(unsigned components);
|
||||
static const glsl_type *bvec(unsigned components);
|
||||
/**@}*/
|
||||
|
||||
/**
|
||||
|
@@ -77,7 +77,7 @@ bool do_copy_propagation(exec_list *instructions);
|
||||
bool do_copy_propagation_elements(exec_list *instructions);
|
||||
bool do_constant_propagation(exec_list *instructions);
|
||||
void do_dead_builtin_varyings(struct gl_context *ctx,
|
||||
exec_list *producer, exec_list *consumer,
|
||||
gl_shader *producer, gl_shader *consumer,
|
||||
unsigned num_tfeedback_decls,
|
||||
class tfeedback_decl *tfeedback_decls);
|
||||
bool do_dead_code(exec_list *instructions, bool uniform_locations_assigned);
|
||||
|
@@ -58,6 +58,15 @@ public:
|
||||
private:
|
||||
virtual void visit_field(const glsl_type *type, const char *name,
|
||||
bool row_major)
|
||||
{
|
||||
(void) type;
|
||||
(void) name;
|
||||
(void) row_major;
|
||||
assert(!"Should not get here.");
|
||||
}
|
||||
|
||||
virtual void visit_field(const glsl_type *type, const char *name,
|
||||
bool row_major, const glsl_type *record_type)
|
||||
{
|
||||
assert(this->index < this->num_variables);
|
||||
|
||||
@@ -85,7 +94,9 @@ private:
|
||||
v->IndexName = v->Name;
|
||||
}
|
||||
|
||||
unsigned alignment = type->std140_base_alignment(v->RowMajor);
|
||||
const unsigned alignment = record_type
|
||||
? record_type->std140_base_alignment(v->RowMajor)
|
||||
: type->std140_base_alignment(v->RowMajor);
|
||||
unsigned size = type->std140_size(v->RowMajor);
|
||||
|
||||
this->offset = glsl_align(this->offset, alignment);
|
||||
@@ -107,6 +118,10 @@ private:
|
||||
|
||||
virtual void visit_field(const glsl_struct_field *field)
|
||||
{
|
||||
/* FINISHME: When support for doubles (dvec4, etc.) is added to the
|
||||
* FINISHME: compiler, this may be incorrect for a structure in a UBO
|
||||
* FINISHME: like struct s { struct { float f } s1; dvec4 v; };.
|
||||
*/
|
||||
this->offset = glsl_align(this->offset,
|
||||
field->type->std140_base_alignment(false));
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ program_resource_visitor::process(const glsl_type *type, const char *name)
|
||||
|| (type->is_array() && type->fields.array->is_interface()));
|
||||
|
||||
char *name_copy = ralloc_strdup(NULL, name);
|
||||
recursion(type, &name_copy, strlen(name), false);
|
||||
recursion(type, &name_copy, strlen(name), false, NULL);
|
||||
ralloc_free(name_copy);
|
||||
}
|
||||
|
||||
@@ -77,24 +77,25 @@ program_resource_visitor::process(ir_variable *var)
|
||||
/* Only strdup the name if we actually will need to modify it. */
|
||||
if (t->is_record() || (t->is_array() && t->fields.array->is_record())) {
|
||||
char *name = ralloc_strdup(NULL, var->name);
|
||||
recursion(var->type, &name, strlen(name), false);
|
||||
recursion(var->type, &name, strlen(name), false, NULL);
|
||||
ralloc_free(name);
|
||||
} else if (t->is_interface()) {
|
||||
char *name = ralloc_strdup(NULL, var->type->name);
|
||||
recursion(var->type, &name, strlen(name), false);
|
||||
recursion(var->type, &name, strlen(name), false, NULL);
|
||||
ralloc_free(name);
|
||||
} else if (t->is_array() && t->fields.array->is_interface()) {
|
||||
char *name = ralloc_strdup(NULL, var->type->fields.array->name);
|
||||
recursion(var->type, &name, strlen(name), false);
|
||||
recursion(var->type, &name, strlen(name), false, NULL);
|
||||
ralloc_free(name);
|
||||
} else {
|
||||
this->visit_field(t, var->name, false);
|
||||
this->visit_field(t, var->name, false, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
program_resource_visitor::recursion(const glsl_type *t, char **name,
|
||||
size_t name_length, bool row_major)
|
||||
size_t name_length, bool row_major,
|
||||
const glsl_type *record_type)
|
||||
{
|
||||
/* Records need to have each field processed individually.
|
||||
*
|
||||
@@ -103,6 +104,9 @@ program_resource_visitor::recursion(const glsl_type *t, char **name,
|
||||
* individually.
|
||||
*/
|
||||
if (t->is_record() || t->is_interface()) {
|
||||
if (record_type == NULL && t->is_record())
|
||||
record_type = t;
|
||||
|
||||
for (unsigned i = 0; i < t->length; i++) {
|
||||
const char *field = t->fields.structure[i].name;
|
||||
size_t new_length = name_length;
|
||||
@@ -118,10 +122,18 @@ program_resource_visitor::recursion(const glsl_type *t, char **name,
|
||||
}
|
||||
|
||||
recursion(t->fields.structure[i].type, name, new_length,
|
||||
t->fields.structure[i].row_major);
|
||||
t->fields.structure[i].row_major, record_type);
|
||||
|
||||
/* Only the first leaf-field of the record gets called with the
|
||||
* record type pointer.
|
||||
*/
|
||||
record_type = NULL;
|
||||
}
|
||||
} else if (t->is_array() && (t->fields.array->is_record()
|
||||
|| t->fields.array->is_interface())) {
|
||||
if (record_type == NULL && t->fields.array->is_record())
|
||||
record_type = t->fields.array;
|
||||
|
||||
for (unsigned i = 0; i < t->length; i++) {
|
||||
size_t new_length = name_length;
|
||||
|
||||
@@ -129,13 +141,26 @@ program_resource_visitor::recursion(const glsl_type *t, char **name,
|
||||
ralloc_asprintf_rewrite_tail(name, &new_length, "[%u]", i);
|
||||
|
||||
recursion(t->fields.array, name, new_length,
|
||||
t->fields.structure[i].row_major);
|
||||
t->fields.structure[i].row_major, record_type);
|
||||
|
||||
/* Only the first leaf-field of the record gets called with the
|
||||
* record type pointer.
|
||||
*/
|
||||
record_type = NULL;
|
||||
}
|
||||
} else {
|
||||
this->visit_field(t, *name, row_major);
|
||||
this->visit_field(t, *name, row_major, record_type);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
program_resource_visitor::visit_field(const glsl_type *type, const char *name,
|
||||
bool row_major,
|
||||
const glsl_type *record_type)
|
||||
{
|
||||
visit_field(type, name, row_major);
|
||||
}
|
||||
|
||||
void
|
||||
program_resource_visitor::visit_field(const glsl_struct_field *field)
|
||||
{
|
||||
@@ -376,6 +401,15 @@ private:
|
||||
|
||||
virtual void visit_field(const glsl_type *type, const char *name,
|
||||
bool row_major)
|
||||
{
|
||||
(void) type;
|
||||
(void) name;
|
||||
(void) row_major;
|
||||
assert(!"Should not get here.");
|
||||
}
|
||||
|
||||
virtual void visit_field(const glsl_type *type, const char *name,
|
||||
bool row_major, const glsl_type *record_type)
|
||||
{
|
||||
assert(!type->is_record());
|
||||
assert(!(type->is_array() && type->fields.array->is_record()));
|
||||
@@ -421,7 +455,9 @@ private:
|
||||
if (this->ubo_block_index != -1) {
|
||||
this->uniforms[id].block_index = this->ubo_block_index;
|
||||
|
||||
unsigned alignment = type->std140_base_alignment(ubo_row_major);
|
||||
const unsigned alignment = record_type
|
||||
? record_type->std140_base_alignment(ubo_row_major)
|
||||
: type->std140_base_alignment(ubo_row_major);
|
||||
this->ubo_byte_offset = glsl_align(this->ubo_byte_offset, alignment);
|
||||
this->uniforms[id].offset = this->ubo_byte_offset;
|
||||
this->ubo_byte_offset += type->std140_size(ubo_row_major);
|
||||
|
@@ -1906,7 +1906,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
goto done;
|
||||
}
|
||||
|
||||
do_dead_builtin_varyings(ctx, sh->ir, NULL,
|
||||
do_dead_builtin_varyings(ctx, sh, NULL,
|
||||
num_tfeedback_decls, tfeedback_decls);
|
||||
|
||||
demote_shader_inputs_and_outputs(sh, ir_var_shader_out);
|
||||
@@ -1921,7 +1921,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
*/
|
||||
gl_shader *const sh = prog->_LinkedShaders[first];
|
||||
|
||||
do_dead_builtin_varyings(ctx, NULL, sh->ir,
|
||||
do_dead_builtin_varyings(ctx, NULL, sh,
|
||||
num_tfeedback_decls, tfeedback_decls);
|
||||
|
||||
demote_shader_inputs_and_outputs(sh, ir_var_shader_in);
|
||||
@@ -1943,7 +1943,7 @@ link_shaders(struct gl_context *ctx, struct gl_shader_program *prog)
|
||||
tfeedback_decls))
|
||||
goto done;
|
||||
|
||||
do_dead_builtin_varyings(ctx, sh_i->ir, sh_next->ir,
|
||||
do_dead_builtin_varyings(ctx, sh_i, sh_next,
|
||||
next == MESA_SHADER_FRAGMENT ? num_tfeedback_decls : 0,
|
||||
tfeedback_decls);
|
||||
|
||||
|
@@ -118,6 +118,19 @@ public:
|
||||
void process(const glsl_type *type, const char *name);
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Method invoked for each leaf of the variable
|
||||
*
|
||||
* \param type Type of the field.
|
||||
* \param name Fully qualified name of the field.
|
||||
* \param row_major For a matrix type, is it stored row-major.
|
||||
* \param record_type Type of the record containing the field.
|
||||
*
|
||||
* The default implementation just calls the other \c visit_field method.
|
||||
*/
|
||||
virtual void visit_field(const glsl_type *type, const char *name,
|
||||
bool row_major, const glsl_type *record_type);
|
||||
|
||||
/**
|
||||
* Method invoked for each leaf of the variable
|
||||
*
|
||||
@@ -144,7 +157,7 @@ private:
|
||||
* terminating \c NUL character.
|
||||
*/
|
||||
void recursion(const glsl_type *t, char **name, size_t name_length,
|
||||
bool row_major);
|
||||
bool row_major, const glsl_type *record_type);
|
||||
};
|
||||
|
||||
void
|
||||
|
@@ -503,7 +503,8 @@ is_loop_terminator(ir_if *ir)
|
||||
|
||||
ir_instruction *const inst =
|
||||
(ir_instruction *) ir->then_instructions.get_head();
|
||||
assert(inst != NULL);
|
||||
if (inst == NULL)
|
||||
return false;
|
||||
|
||||
if (inst->ir_type != ir_type_loop_jump)
|
||||
return false;
|
||||
|
@@ -409,7 +409,7 @@ lower_texcoord_array(exec_list *ir, const varying_info_visitor *info)
|
||||
|
||||
void
|
||||
do_dead_builtin_varyings(struct gl_context *ctx,
|
||||
exec_list *producer, exec_list *consumer,
|
||||
gl_shader *producer, gl_shader *consumer,
|
||||
unsigned num_tfeedback_decls,
|
||||
tfeedback_decl *tfeedback_decls)
|
||||
{
|
||||
@@ -431,44 +431,55 @@ do_dead_builtin_varyings(struct gl_context *ctx,
|
||||
varying_info_visitor consumer_info(ir_var_shader_in);
|
||||
|
||||
if (producer) {
|
||||
producer_info.get(producer, num_tfeedback_decls, tfeedback_decls);
|
||||
producer_info.get(producer->ir, num_tfeedback_decls, tfeedback_decls);
|
||||
|
||||
if (!consumer) {
|
||||
/* At least eliminate unused gl_TexCoord elements. */
|
||||
if (producer_info.lower_texcoord_array) {
|
||||
lower_texcoord_array(producer, &producer_info);
|
||||
lower_texcoord_array(producer->ir, &producer_info);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (consumer) {
|
||||
consumer_info.get(consumer, 0, NULL);
|
||||
consumer_info.get(consumer->ir, 0, NULL);
|
||||
|
||||
if (!producer) {
|
||||
/* At least eliminate unused gl_TexCoord elements. */
|
||||
if (consumer_info.lower_texcoord_array) {
|
||||
lower_texcoord_array(consumer, &consumer_info);
|
||||
lower_texcoord_array(consumer->ir, &consumer_info);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Eliminate the varyings unused by the other shader. */
|
||||
/* Eliminate the outputs unused by the consumer. */
|
||||
if (producer_info.lower_texcoord_array ||
|
||||
producer_info.color_usage ||
|
||||
producer_info.has_fog) {
|
||||
replace_varyings_visitor(producer,
|
||||
replace_varyings_visitor(producer->ir,
|
||||
&producer_info,
|
||||
consumer_info.texcoord_usage,
|
||||
consumer_info.color_usage,
|
||||
consumer_info.has_fog);
|
||||
}
|
||||
|
||||
/* The gl_TexCoord fragment shader inputs can be initialized
|
||||
* by GL_COORD_REPLACE, so we can't eliminate them.
|
||||
*
|
||||
* This doesn't prevent elimination of the gl_TexCoord elements which
|
||||
* are not read by the fragment shader. We want to eliminate those anyway.
|
||||
*/
|
||||
if (consumer->Type == GL_FRAGMENT_SHADER) {
|
||||
producer_info.texcoord_usage = (1 << MAX_TEXTURE_COORD_UNITS) - 1;
|
||||
}
|
||||
|
||||
/* Eliminate the inputs uninitialized by the producer. */
|
||||
if (consumer_info.lower_texcoord_array ||
|
||||
consumer_info.color_usage ||
|
||||
consumer_info.has_fog) {
|
||||
replace_varyings_visitor(consumer,
|
||||
replace_varyings_visitor(consumer->ir,
|
||||
&consumer_info,
|
||||
producer_info.texcoord_usage,
|
||||
producer_info.color_usage,
|
||||
|
@@ -132,8 +132,6 @@ apple_glx_swap_buffers(void *ptr)
|
||||
{
|
||||
struct apple_glx_context *ac = ptr;
|
||||
|
||||
/* This may not be needed with CGLFlushDrawable: */
|
||||
glFlush();
|
||||
apple_cgl.flush_drawable(ac->context_obj);
|
||||
}
|
||||
|
||||
|
@@ -40,9 +40,10 @@
|
||||
#ifdef GLX_USE_APPLEGL
|
||||
#include <pthread.h>
|
||||
#include "apple_glx_drawable.h"
|
||||
#include "glx_error.h"
|
||||
#endif
|
||||
|
||||
#include "glx_error.h"
|
||||
|
||||
#define WARN_ONCE_GLX_1_3(a, b) { \
|
||||
static int warned=1; \
|
||||
if(warned) { \
|
||||
@@ -279,7 +280,16 @@ GetDrawableAttribute(Display * dpy, GLXDrawable drawable,
|
||||
unsigned int num_attributes;
|
||||
GLboolean use_glx_1_3;
|
||||
|
||||
if ((dpy == NULL) || (drawable == 0)) {
|
||||
if (dpy == NULL)
|
||||
return 0;
|
||||
|
||||
/* Page 38 (page 52 of the PDF) of glxencode1.3.pdf says:
|
||||
*
|
||||
* "If drawable is not a valid GLX drawable, a GLXBadDrawable error is
|
||||
* generated."
|
||||
*/
|
||||
if (drawable == 0) {
|
||||
__glXSendError(dpy, GLXBadDrawable, 0, X_GLXGetDrawableAttributes, false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@@ -78,7 +78,7 @@
|
||||
<return type="GLboolean"/>
|
||||
</function>
|
||||
|
||||
<function name="BindRenderbufferEXT" offset="assign">
|
||||
<function name="BindRenderbufferEXT" offset="assign" deprecated="3.1">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="renderbuffer" type="GLuint"/>
|
||||
<glx rop="4316"/>
|
||||
@@ -112,7 +112,7 @@
|
||||
<return type="GLboolean"/>
|
||||
</function>
|
||||
|
||||
<function name="BindFramebufferEXT" offset="assign">
|
||||
<function name="BindFramebufferEXT" offset="assign" deprecated="3.1">
|
||||
<param name="target" type="GLenum"/>
|
||||
<param name="framebuffer" type="GLuint"/>
|
||||
<glx rop="4319"/>
|
||||
|
@@ -704,9 +704,14 @@ _mesa_meta_begin(struct gl_context *ctx, GLbitfield state)
|
||||
_mesa_LoadIdentity();
|
||||
_mesa_MatrixMode(GL_PROJECTION);
|
||||
_mesa_LoadIdentity();
|
||||
_mesa_Ortho(0.0, ctx->DrawBuffer->Width,
|
||||
0.0, ctx->DrawBuffer->Height,
|
||||
-1.0, 1.0);
|
||||
|
||||
/* glOrtho with width = 0 or height = 0 generates GL_INVALID_VALUE.
|
||||
* This can occur when there is no draw buffer.
|
||||
*/
|
||||
if (ctx->DrawBuffer->Width != 0 && ctx->DrawBuffer->Height != 0)
|
||||
_mesa_Ortho(0.0, ctx->DrawBuffer->Width,
|
||||
0.0, ctx->DrawBuffer->Height,
|
||||
-1.0, 1.0);
|
||||
}
|
||||
|
||||
if (state & MESA_META_CLIP) {
|
||||
@@ -1532,6 +1537,9 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
|
||||
"}\n";
|
||||
|
||||
fs_source = ralloc_asprintf(mem_ctx,
|
||||
"#ifdef GL_ES\n"
|
||||
"precision highp float;\n"
|
||||
"#endif\n"
|
||||
"uniform %s texSampler;\n"
|
||||
"varying vec2 texCoords;\n"
|
||||
"void main()\n"
|
||||
@@ -1556,6 +1564,9 @@ setup_glsl_blit_framebuffer(struct gl_context *ctx,
|
||||
_mesa_is_desktop_gl(ctx) ? "130" : "300 es");
|
||||
fs_source = ralloc_asprintf(mem_ctx,
|
||||
"#version %s\n"
|
||||
"#ifdef GL_ES\n"
|
||||
"precision highp float;\n"
|
||||
"#endif\n"
|
||||
"uniform %s texSampler;\n"
|
||||
"in vec2 texCoords;\n"
|
||||
"out vec4 out_color;\n"
|
||||
@@ -1879,19 +1890,24 @@ _mesa_meta_BlitFramebuffer(struct gl_context *ctx,
|
||||
const GLenum rb_base_format =
|
||||
_mesa_base_tex_format(ctx, colorReadRb->InternalFormat);
|
||||
|
||||
newTex = alloc_texture(tex, srcW, srcH, rb_base_format);
|
||||
setup_copypix_texture(ctx, tex, newTex, srcX, srcY, srcW, srcH,
|
||||
/* Using the exact source rectangle to create the texture does incorrect
|
||||
* linear filtering along the edges. So, allocate the texture extended along
|
||||
* edges by one pixel in x, y directions.
|
||||
*/
|
||||
newTex = alloc_texture(tex, srcW + 2, srcH + 2, rb_base_format);
|
||||
setup_copypix_texture(ctx, tex, newTex,
|
||||
srcX - 1, srcY - 1, srcW + 2, srcH + 2,
|
||||
rb_base_format, filter);
|
||||
/* texcoords (after texture allocation!) */
|
||||
{
|
||||
verts[0].s = 0.0F;
|
||||
verts[0].t = 0.0F;
|
||||
verts[1].s = tex->Sright;
|
||||
verts[1].t = 0.0F;
|
||||
verts[2].s = tex->Sright;
|
||||
verts[2].t = tex->Ttop;
|
||||
verts[3].s = 0.0F;
|
||||
verts[3].t = tex->Ttop;
|
||||
verts[0].s = 1.0F;
|
||||
verts[0].t = 1.0F;
|
||||
verts[1].s = tex->Sright - 1.0F;
|
||||
verts[1].t = 1.0F;
|
||||
verts[2].s = tex->Sright - 1.0F;
|
||||
verts[2].t = tex->Ttop - 1.0F;
|
||||
verts[3].s = 1.0F;
|
||||
verts[3].t = tex->Ttop - 1.0F;
|
||||
|
||||
/* upload new vertex data */
|
||||
_mesa_BufferSubData(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts);
|
||||
@@ -2129,6 +2145,9 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
|
||||
" gl_Position = position;\n"
|
||||
"}\n";
|
||||
const char *fs_source =
|
||||
"#ifdef GL_ES\n"
|
||||
"precision highp float;\n"
|
||||
"#endif\n"
|
||||
"uniform vec4 color;\n"
|
||||
"void main()\n"
|
||||
"{\n"
|
||||
@@ -2188,6 +2207,9 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
|
||||
const char *fs_int_source =
|
||||
ralloc_asprintf(shader_source_mem_ctx,
|
||||
"#version %s\n"
|
||||
"#ifdef GL_ES\n"
|
||||
"precision highp float;\n"
|
||||
"#endif\n"
|
||||
"uniform ivec4 color;\n"
|
||||
"out ivec4 out_color;\n"
|
||||
"\n"
|
||||
@@ -3416,6 +3438,9 @@ setup_glsl_generate_mipmap(struct gl_context *ctx,
|
||||
|
||||
fs_source = ralloc_asprintf(mem_ctx,
|
||||
"#extension GL_EXT_texture_array : enable\n"
|
||||
"#ifdef GL_ES\n"
|
||||
"precision highp float;\n"
|
||||
"#endif\n"
|
||||
"uniform %s texSampler;\n"
|
||||
"varying vec3 texCoords;\n"
|
||||
"void main()\n"
|
||||
@@ -3439,6 +3464,9 @@ setup_glsl_generate_mipmap(struct gl_context *ctx,
|
||||
_mesa_is_desktop_gl(ctx) ? "130" : "300 es");
|
||||
fs_source = ralloc_asprintf(mem_ctx,
|
||||
"#version %s\n"
|
||||
"#ifdef GL_ES\n"
|
||||
"precision highp float;\n"
|
||||
"#endif\n"
|
||||
"uniform %s texSampler;\n"
|
||||
"in vec3 texCoords;\n"
|
||||
"out vec4 out_color;\n"
|
||||
@@ -4095,10 +4123,29 @@ _mesa_meta_GetTexImage(struct gl_context *ctx,
|
||||
_mesa_get_format_datatype(texImage->TexFormat)
|
||||
== GL_UNSIGNED_NORMALIZED) {
|
||||
struct gl_texture_object *texObj = texImage->TexObject;
|
||||
const GLuint slice = 0; /* only 2D compressed textures for now */
|
||||
GLuint slice;
|
||||
/* Need to unlock the texture here to prevent deadlock... */
|
||||
_mesa_unlock_texture(ctx, texObj);
|
||||
decompress_texture_image(ctx, texImage, slice, format, type, pixels);
|
||||
for (slice = 0; slice < texImage->Depth; slice++) {
|
||||
void *dst;
|
||||
if (texImage->TexObject->Target == GL_TEXTURE_2D_ARRAY) {
|
||||
/* Setup pixel packing. SkipPixels and SkipRows will be applied
|
||||
* in the decompress_texture_image() function's call to
|
||||
* glReadPixels but we need to compute the dest slice's address
|
||||
* here (according to SkipImages and ImageHeight).
|
||||
*/
|
||||
struct gl_pixelstore_attrib packing = ctx->Pack;
|
||||
packing.SkipPixels = 0;
|
||||
packing.SkipRows = 0;
|
||||
dst = _mesa_image_address3d(&packing, pixels, texImage->Width,
|
||||
texImage->Height, format, type,
|
||||
slice, 0, 0);
|
||||
}
|
||||
else {
|
||||
dst = pixels;
|
||||
}
|
||||
decompress_texture_image(ctx, texImage, slice, format, type, dst);
|
||||
}
|
||||
/* ... and relock it */
|
||||
_mesa_lock_texture(ctx, texObj);
|
||||
}
|
||||
|
@@ -1,33 +1,75 @@
|
||||
<!--
|
||||
|
||||
============================================
|
||||
Application bugs worked around in this file:
|
||||
============================================
|
||||
|
||||
* Various Unigine products don't use the #version and #extension GLSL
|
||||
directives, meaning they only get GLSL 1.10 and no extensions for their
|
||||
shaders.
|
||||
Enabling all extensions for Unigine fixes most issues, but the GLSL version
|
||||
is still 1.10.
|
||||
|
||||
* Unigine Heaven 3.0 with ARB_texture_multisample uses a "ivec4 * vec4"
|
||||
expression, which fails to compile with GLSL 1.10.
|
||||
Adding "#version 130" fixes this.
|
||||
|
||||
* Unigine Heaven 3.0 with ARB_shader_bit_encoding uses the uint keyword, which
|
||||
fails to compile with GLSL 1.10.
|
||||
Adding "#version 130" fixes this.
|
||||
|
||||
* Unigine Heaven 3.0 with ARB_shader_bit_encoding uses a "uint & int"
|
||||
expression, which fails (and should fail) to compile with any GLSL version.
|
||||
Disabling ARB_shader_bit_encoding fixes this.
|
||||
|
||||
TODO: document the other workarounds.
|
||||
|
||||
-->
|
||||
|
||||
<driconf>
|
||||
<device screen="0" driver="i965">
|
||||
<!-- Please always enable app-specific workarounds for all drivers and
|
||||
screens. -->
|
||||
<device>
|
||||
<application name="Unigine Sanctuary" executable="Sanctuary">
|
||||
<option name="force_glsl_extensions_warn" value="true" />
|
||||
<option name="disable_blend_func_extended" value="true" />
|
||||
</application>
|
||||
|
||||
<application name="Unigine Tropics" executable="Tropics">
|
||||
<option name="force_glsl_extensions_warn" value="true" />
|
||||
<option name="disable_blend_func_extended" value="true" />
|
||||
</application>
|
||||
|
||||
<application name="Unigine Heaven (32-bit)" executable="heaven_x86">
|
||||
<option name="force_glsl_extensions_warn" value="true" />
|
||||
<option name="disable_blend_func_extended" value="true" />
|
||||
<option name="force_glsl_version" value="130" />
|
||||
<option name="disable_shader_bit_encoding" value="true" />
|
||||
</application>
|
||||
|
||||
<application name="Unigine Heaven (64-bit)" executable="heaven_x64">
|
||||
<option name="force_glsl_extensions_warn" value="true" />
|
||||
<option name="disable_blend_func_extended" value="true" />
|
||||
<option name="force_glsl_version" value="130" />
|
||||
<option name="disable_shader_bit_encoding" value="true" />
|
||||
</application>
|
||||
|
||||
<application name="Unigine OilRush (32-bit)" executable="OilRush_x86">
|
||||
<option name="disable_blend_func_extended" value="true" />
|
||||
</application>
|
||||
|
||||
<application name="Unigine OilRush (64-bit)" executable="OilRush_x64">
|
||||
<option name="disable_blend_func_extended" value="true" />
|
||||
</application>
|
||||
|
||||
<application name="Savage 2" executable="savage2.bin">
|
||||
<option name="disable_glsl_line_continuations" value="true" />
|
||||
</application>
|
||||
|
||||
<application name="Topogun (32-bit)" executable="topogun32">
|
||||
<option name="always_have_depth_buffer" value="true" />
|
||||
</application>
|
||||
|
||||
<application name="Topogun (64-bit)" executable="topogun64">
|
||||
<option name="always_have_depth_buffer" value="true" />
|
||||
</application>
|
||||
|
@@ -812,7 +812,9 @@ static void parseOptConfAttr (struct OptConfData *data, const XML_Char **attr) {
|
||||
driOptionCache *cache = data->cache;
|
||||
GLuint opt = findOption (cache, name);
|
||||
if (cache->info[opt].name == NULL)
|
||||
XML_WARNING ("undefined option: %s.", name);
|
||||
/* don't use XML_WARNING, drirc defines options for all drivers,
|
||||
* but not all drivers support them */
|
||||
return;
|
||||
else if (getenv (cache->info[opt].name))
|
||||
/* don't use XML_WARNING, we want the user to see this! */
|
||||
fprintf (stderr, "ATTENTION: option value of option %s ignored.\n",
|
||||
|
@@ -95,6 +95,16 @@ DRI_CONF_OPT_BEGIN_B(disable_glsl_line_continuations, def) \
|
||||
DRI_CONF_DESC(en,gettext("Disable backslash-based line continuations in GLSL source")) \
|
||||
DRI_CONF_OPT_END
|
||||
|
||||
#define DRI_CONF_DISABLE_SHADER_BIT_ENCODING(def) \
|
||||
DRI_CONF_OPT_BEGIN_B(disable_shader_bit_encoding, def) \
|
||||
DRI_CONF_DESC(en,gettext("Disable GL_ARB_shader_bit_encoding")) \
|
||||
DRI_CONF_OPT_END
|
||||
|
||||
#define DRI_CONF_FORCE_GLSL_VERSION(def) \
|
||||
DRI_CONF_OPT_BEGIN_V(force_glsl_version, int, def, "0:999") \
|
||||
DRI_CONF_DESC(en,gettext("Force a default GLSL version for shaders that lack an explicit #version line")) \
|
||||
DRI_CONF_OPT_END
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -266,15 +276,6 @@ DRI_CONF_OPT_BEGIN_V(texture_units,int,def, # min ":" # max ) \
|
||||
DRI_CONF_DESC(en,gettext("Number of texture units used")) \
|
||||
DRI_CONF_OPT_END
|
||||
|
||||
#define DRI_CONF_ALLOW_LARGE_TEXTURES(def) \
|
||||
DRI_CONF_OPT_BEGIN_V(allow_large_textures,enum,def,"0:2") \
|
||||
DRI_CONF_DESC_BEGIN(en,gettext("Support larger textures not guaranteed to fit into graphics memory")) \
|
||||
DRI_CONF_ENUM(0,gettext("No")) \
|
||||
DRI_CONF_ENUM(1,gettext("At least 1 texture must fit under worst-case assumptions")) \
|
||||
DRI_CONF_ENUM(2,gettext("Announce hardware limits")) \
|
||||
DRI_CONF_DESC_END \
|
||||
DRI_CONF_OPT_END
|
||||
|
||||
#define DRI_CONF_TEXTURE_BLEND_QUALITY(def,range) \
|
||||
DRI_CONF_OPT_BEGIN_V(texture_blend_quality,float,def,range) \
|
||||
DRI_CONF_DESC(en,gettext("Texture filtering quality vs. speed, AKA “brilinear” texture filtering")) \
|
||||
|
@@ -39,7 +39,7 @@ intelNewTextureObject(struct gl_context * ctx, GLuint name, GLenum target)
|
||||
if (obj == NULL)
|
||||
return NULL;
|
||||
|
||||
_mesa_initialize_texture_object(&obj->base, name, target);
|
||||
_mesa_initialize_texture_object(ctx, &obj->base, name, target);
|
||||
|
||||
obj->needs_validate = true;
|
||||
|
||||
|
@@ -171,6 +171,7 @@ try_pbo_upload(struct gl_context *ctx,
|
||||
0, 0, false,
|
||||
image->Width, image->Height, GL_COPY)) {
|
||||
DBG("%s: blit failed\n", __FUNCTION__);
|
||||
intel_miptree_release(&pbo_mt);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -1239,6 +1239,8 @@ struct brw_context
|
||||
|
||||
__DRIcontext *driContext;
|
||||
struct intel_screen *intelScreen;
|
||||
void (*saved_viewport)(struct gl_context *ctx,
|
||||
GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
};
|
||||
|
||||
/*======================================================================
|
||||
|
@@ -2427,7 +2427,7 @@ vec4_visitor::visit(ir_texture *ir)
|
||||
}
|
||||
} else /* brw->gen == 4 */ {
|
||||
mrf = param_base;
|
||||
writemask = WRITEMASK_Z;
|
||||
writemask = WRITEMASK_W;
|
||||
}
|
||||
emit(MOV(dst_reg(MRF, mrf, lod_type, writemask), lod));
|
||||
} else if (ir->op == ir_txf) {
|
||||
@@ -2506,7 +2506,7 @@ vec4_visitor::swizzle_result(ir_texture *ir, src_reg orig_val, int sampler)
|
||||
}
|
||||
|
||||
int zero_mask = 0, one_mask = 0, copy_mask = 0;
|
||||
int swizzle[4];
|
||||
int swizzle[4] = {0};
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
switch (GET_SWZ(s, i)) {
|
||||
|
@@ -138,11 +138,13 @@ brw_upload_vs_unit(struct brw_context *brw)
|
||||
vs->thread4.max_threads = CLAMP(brw->urb.nr_vs_entries / 2,
|
||||
1, brw->max_vs_threads) - 1;
|
||||
|
||||
/* No samplers for ARB_vp programs:
|
||||
*/
|
||||
/* It has to be set to 0 for Ironlake
|
||||
*/
|
||||
vs->vs5.sampler_count = 0;
|
||||
if (brw->gen == 5)
|
||||
vs->vs5.sampler_count = 0; /* hardware requirement */
|
||||
else {
|
||||
/* CACHE_NEW_SAMPLER */
|
||||
vs->vs5.sampler_count = (brw->sampler.count + 3) / 4;
|
||||
}
|
||||
|
||||
|
||||
if (unlikely(INTEL_DEBUG & DEBUG_STATS))
|
||||
vs->thread4.stats_enable = 1;
|
||||
@@ -151,6 +153,19 @@ brw_upload_vs_unit(struct brw_context *brw)
|
||||
*/
|
||||
vs->vs6.vs_enable = 1;
|
||||
|
||||
/* Set the sampler state pointer, and its reloc
|
||||
*/
|
||||
if (brw->sampler.count) {
|
||||
vs->vs5.sampler_state_pointer =
|
||||
(brw->batch.bo->offset + brw->sampler.offset) >> 5;
|
||||
drm_intel_bo_emit_reloc(brw->batch.bo,
|
||||
brw->vs.state_offset +
|
||||
offsetof(struct brw_vs_unit_state, vs5),
|
||||
brw->batch.bo,
|
||||
brw->sampler.offset | vs->vs5.sampler_count,
|
||||
I915_GEM_DOMAIN_INSTRUCTION, 0);
|
||||
}
|
||||
|
||||
/* Emit scratch space relocation */
|
||||
if (brw->vs.prog_data->base.total_scratch != 0) {
|
||||
drm_intel_bo_emit_reloc(brw->batch.bo,
|
||||
@@ -172,7 +187,7 @@ const struct brw_tracked_state brw_vs_unit = {
|
||||
BRW_NEW_CURBE_OFFSETS |
|
||||
BRW_NEW_URB_FENCE |
|
||||
BRW_NEW_VERTEX_PROGRAM),
|
||||
.cache = CACHE_NEW_VS_PROG
|
||||
.cache = CACHE_NEW_VS_PROG | CACHE_NEW_SAMPLER
|
||||
},
|
||||
.emit = brw_upload_vs_unit,
|
||||
};
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user