mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 10:50:16 +01:00
Merge branch 'mesa_7_6_branch'
This commit is contained in:
commit
4bced42341
8 changed files with 52 additions and 20 deletions
|
|
@ -124,7 +124,7 @@ INSTALL_INC_DIR = $(includedir)
|
|||
DRI_DRIVER_INSTALL_DIR = @DRI_DRIVER_INSTALL_DIR@
|
||||
|
||||
# Where libGL will look for DRI hardware drivers
|
||||
DRI_DRIVER_SEARCH_DIR = $(DRI_DRIVER_INSTALL_DIR)
|
||||
DRI_DRIVER_SEARCH_DIR = @DRI_DRIVER_SEARCH_DIR@
|
||||
|
||||
# Xorg driver install directory (for xorg state-tracker)
|
||||
XORG_DRIVER_INSTALL_DIR = @XORG_DRIVER_INSTALL_DIR@
|
||||
|
|
|
|||
|
|
@ -649,6 +649,13 @@ AC_ARG_WITH([dri-driverdir],
|
|||
[DRI_DRIVER_INSTALL_DIR="$withval"],
|
||||
[DRI_DRIVER_INSTALL_DIR='${libdir}/dri'])
|
||||
AC_SUBST([DRI_DRIVER_INSTALL_DIR])
|
||||
dnl Extra search path for DRI drivers
|
||||
AC_ARG_WITH([dri-searchpath],
|
||||
[AS_HELP_STRING([--with-dri-searchpath=DIRS...],
|
||||
[semicolon delimited DRI driver search directories @<:@${libdir}/dri@:>@])],
|
||||
[DRI_DRIVER_SEARCH_DIR="$withval"],
|
||||
[DRI_DRIVER_SEARCH_DIR='${DRI_DRIVER_INSTALL_DIR}'])
|
||||
AC_SUBST([DRI_DRIVER_SEARCH_DIR])
|
||||
dnl Direct rendering or just indirect rendering
|
||||
AC_ARG_ENABLE([driglx-direct],
|
||||
[AS_HELP_STRING([--disable-driglx-direct],
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ Display(void)
|
|||
|
||||
glUseProgram_func(Program);
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
/* draw to user framebuffer */
|
||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBobject);
|
||||
|
||||
|
|
@ -68,18 +70,23 @@ Display(void)
|
|||
glPopMatrix();
|
||||
|
||||
/* read from user framebuffer */
|
||||
/* bottom half = colorbuffer 0 */
|
||||
/* left half = colorbuffer 0 */
|
||||
glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
|
||||
glReadPixels(0, 0, Width, Height / 2, GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
glPixelStorei(GL_PACK_ROW_LENGTH, Width);
|
||||
glPixelStorei(GL_PACK_SKIP_PIXELS, 0);
|
||||
glReadPixels(0, 0, Width / 2, Height, GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
buffer);
|
||||
/* top half = colorbuffer 1 */
|
||||
|
||||
/* right half = colorbuffer 1 */
|
||||
glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);
|
||||
glReadPixels(0, Height/2, Width, Height - Height / 2,
|
||||
glPixelStorei(GL_PACK_SKIP_PIXELS, Width / 2);
|
||||
glReadPixels(Width / 2, 0, Width - Width / 2, Height,
|
||||
GL_RGBA, GL_UNSIGNED_BYTE,
|
||||
buffer + Width * (Height / 2) * 4);
|
||||
buffer);
|
||||
|
||||
/* draw to window */
|
||||
glUseProgram_func(0);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
|
||||
glWindowPos2iARB(0, 0);
|
||||
glDrawPixels(Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
|
|
|
|||
|
|
@ -285,6 +285,12 @@ main(int argc, char** argv)
|
|||
glutInitWindowSize (600, 600);
|
||||
glutCreateWindow (argv[0]);
|
||||
glewInit();
|
||||
|
||||
if (!glutExtensionSupported("GL_EXT_texture_compression_s3tc")) {
|
||||
fprintf(stderr, "This test requires GL_EXT_texture_compression_s3tc.\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
myInit();
|
||||
glutReshapeFunc (myReshape);
|
||||
glutDisplayFunc(display);
|
||||
|
|
|
|||
|
|
@ -596,8 +596,10 @@ driCreateDrawable(__GLXscreenConfigs * psc,
|
|||
pdraw->drawable = drawable;
|
||||
pdraw->psc = psc;
|
||||
|
||||
if (!XF86DRICreateDrawable(psc->dpy, psc->scr, drawable, &hwDrawable))
|
||||
if (!XF86DRICreateDrawable(psc->dpy, psc->scr, drawable, &hwDrawable)) {
|
||||
Xfree(pdraw);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Create a new drawable */
|
||||
pdraw->driDrawable =
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ pcedit = sed \
|
|||
-e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \
|
||||
-e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \
|
||||
-e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \
|
||||
-e 's,@DRI_DRIVER_DIR@,$(DRI_DRIVER_SEARCH_DIR),' \
|
||||
-e 's,@DRI_DRIVER_DIR@,$(DRI_DRIVER_INSTALL_DIR),' \
|
||||
-e 's,@DRI_PC_REQ_PRIV@,$(DRI_PC_REQ_PRIV),'
|
||||
|
||||
dri.pc: dri.pc.in
|
||||
|
|
|
|||
|
|
@ -665,6 +665,15 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
|
|||
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0;
|
||||
GLint skipPixels;
|
||||
ubyte *stmap;
|
||||
struct gl_pixelstore_attrib clippedUnpack = *unpack;
|
||||
|
||||
if (!zoom) {
|
||||
if (!_mesa_clip_drawpixels(ctx, &x, &y, &width, &height,
|
||||
&clippedUnpack)) {
|
||||
/* totally clipped */
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
strb = st_renderbuffer(ctx->DrawBuffer->
|
||||
Attachment[BUFFER_STENCIL].Renderbuffer);
|
||||
|
|
@ -685,7 +694,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
|
|||
|
||||
stmap = screen->transfer_map(screen, pt);
|
||||
|
||||
pixels = _mesa_map_pbo_source(ctx, unpack, pixels);
|
||||
pixels = _mesa_map_pbo_source(ctx, &clippedUnpack, pixels);
|
||||
assert(pixels);
|
||||
|
||||
/* if width > MAX_WIDTH, have to process image in chunks */
|
||||
|
|
@ -698,17 +707,18 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
|
|||
GLubyte sValues[MAX_WIDTH];
|
||||
GLuint zValues[MAX_WIDTH];
|
||||
GLenum destType = GL_UNSIGNED_BYTE;
|
||||
const GLvoid *source = _mesa_image_address2d(unpack, pixels,
|
||||
const GLvoid *source = _mesa_image_address2d(&clippedUnpack, pixels,
|
||||
width, height,
|
||||
format, type,
|
||||
row, skipPixels);
|
||||
_mesa_unpack_stencil_span(ctx, spanWidth, destType, sValues,
|
||||
type, source, unpack,
|
||||
type, source, &clippedUnpack,
|
||||
ctx->_ImageTransferState);
|
||||
|
||||
if (format == GL_DEPTH_STENCIL) {
|
||||
_mesa_unpack_depth_span(ctx, spanWidth, GL_UNSIGNED_INT, zValues,
|
||||
(1 << 24) - 1, type, source, unpack);
|
||||
(1 << 24) - 1, type, source,
|
||||
&clippedUnpack);
|
||||
}
|
||||
|
||||
if (zoom) {
|
||||
|
|
@ -779,7 +789,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
|
|||
skipPixels += spanWidth;
|
||||
}
|
||||
|
||||
_mesa_unmap_pbo_source(ctx, unpack);
|
||||
_mesa_unmap_pbo_source(ctx, &clippedUnpack);
|
||||
|
||||
/* unmap the stencil buffer */
|
||||
screen->transfer_unmap(screen, pt);
|
||||
|
|
|
|||
|
|
@ -1309,7 +1309,8 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level,
|
|||
srcX, srcY,
|
||||
width, height);
|
||||
|
||||
if (baseFormat == GL_DEPTH_COMPONENT &&
|
||||
if ((baseFormat == GL_DEPTH_COMPONENT ||
|
||||
baseFormat == GL_DEPTH_STENCIL) &&
|
||||
pf_is_depth_and_stencil(stImage->pt->format))
|
||||
transfer_usage = PIPE_TRANSFER_READ_WRITE;
|
||||
else
|
||||
|
|
@ -1322,7 +1323,7 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level,
|
|||
destX, destY, width, height);
|
||||
|
||||
if (baseFormat == GL_DEPTH_COMPONENT ||
|
||||
baseFormat == GL_DEPTH24_STENCIL8) {
|
||||
baseFormat == GL_DEPTH_STENCIL) {
|
||||
const GLboolean scaleOrBias = (ctx->Pixel.DepthScale != 1.0F ||
|
||||
ctx->Pixel.DepthBias != 0.0F);
|
||||
GLint row, yStep;
|
||||
|
|
@ -1455,7 +1456,7 @@ st_copy_texsubimage(GLcontext *ctx,
|
|||
struct gl_texture_image *texImage =
|
||||
_mesa_select_tex_image(ctx, texObj, target, level);
|
||||
struct st_texture_image *stImage = st_texture_image(texImage);
|
||||
const GLenum texBaseFormat = texImage->InternalFormat;
|
||||
const GLenum texBaseFormat = texImage->_BaseFormat;
|
||||
struct gl_framebuffer *fb = ctx->ReadBuffer;
|
||||
struct st_renderbuffer *strb;
|
||||
struct pipe_context *pipe = ctx->st->pipe;
|
||||
|
|
@ -1476,12 +1477,9 @@ st_copy_texsubimage(GLcontext *ctx,
|
|||
|
||||
/* determine if copying depth or color data */
|
||||
if (texBaseFormat == GL_DEPTH_COMPONENT ||
|
||||
texBaseFormat == GL_DEPTH24_STENCIL8) {
|
||||
texBaseFormat == GL_DEPTH_STENCIL) {
|
||||
strb = st_renderbuffer(fb->_DepthBuffer);
|
||||
}
|
||||
else if (texBaseFormat == GL_DEPTH_STENCIL_EXT) {
|
||||
strb = st_renderbuffer(fb->_StencilBuffer);
|
||||
}
|
||||
else {
|
||||
/* texBaseFormat == GL_RGB, GL_RGBA, GL_ALPHA, etc */
|
||||
strb = st_renderbuffer(fb->_ColorReadBuffer);
|
||||
|
|
@ -1567,6 +1565,8 @@ st_copy_texsubimage(GLcontext *ctx,
|
|||
use_fallback = GL_FALSE;
|
||||
}
|
||||
else if (format_writemask &&
|
||||
texBaseFormat != GL_DEPTH_COMPONENT &&
|
||||
texBaseFormat != GL_DEPTH_STENCIL &&
|
||||
screen->is_format_supported(screen, src_format,
|
||||
PIPE_TEXTURE_2D,
|
||||
PIPE_TEXTURE_USAGE_SAMPLER,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue