Compare commits

...

21 Commits

Author SHA1 Message Date
Aaron Plattner
ad7d36e919 Fix __glXInitializeVisualConfigFromTags's handling of unrecognized fbconfig tags.
__glXInitializeVisualConfigFromTags doesn't skip the payload of
unrecognized tags.  Instead, it treats the value as if it were the
next tag, which can happen if the server's GLX extension is not
Mesa's.  For example, this falls down when NVIDIA sends a
GLX_FLOAT_COMPONENTS_NV = 0 pair, causing
__glXInitializeVisualConfigFromTags to bail out early.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
2010-04-23 11:48:11 -07:00
Jerome Glisse
eb4dc54788 r600: don't enable depth test if there is no depth buffer
If there is no depth buffer bound to current context don't
enable depth test. GL states that if depth test is enabled
without depth buffer it's as if depth buffer always pass.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
2010-04-23 11:56:06 +02:00
Michel Dänzer
c37e275e77 glx/dri2: Fix build with dri2proto which doesn't define X_DRI2SwapInterval. 2010-04-23 11:16:03 +02:00
Tormod Volden
355370e30b radeon: 9800 SE has only one quadpipe
Although these cards have 2 pipelines on the silicon only
the first passed the QA and the other should be disabled.

http://www.digital-daily.com/video/ati-radeon9800se/
http://www.rojakpot.com/showarticle.aspx?artno=101&pgno=1

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
2010-04-22 17:14:15 -04:00
Brian Paul
b1a9c76b57 st/mesa: add cases for MESA_FORMAT_Z24_X8, MESA_FORMAT_X8_Z24 2010-04-22 11:06:19 -06:00
Brian Paul
4d7ef6e06b mesa: fix conversion errors in signed_rgba8888[rev] texel fetch
Without the cast the returned texel colors were wrong.
Also, we don't need the "& 0xff" part anymore.
Bug found by Vinson Lee.
2010-04-22 11:06:19 -06:00
Alex Deucher
986eb4b99f r300: fix vertex unit setup
RV3xx is 2, RV560,RV570 is 8

Noticed by Tormod Volden.
2010-04-22 02:33:10 -04:00
Aaron Plattner
2e995cdf25 progs/demos: Fix the progs/demos/rain help text
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-21 18:13:19 -06:00
Dan Nicholson
88be2171e7 egl: Pass flags to locate Xlib headers and libraries
eglplatform.h pulls in Xlib.h on X11 platforms. Likewise, the egl glx
driver and egl programs needs to link to libX11. Make sure we use the
locations the user told us about.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
2010-04-19 20:21:57 -07:00
Dan Nicholson
8e5effefc7 progs: Fix linking of Xlib demos for non-autoconf builds
The Xlib demos were fixed to use $(X11_LIBS) so that configure could
detect the proper directory to link the library from, but this broke
the non-autoconf builds. Give X11_LIBS a default value to fallback on.
(cherry picked from commit e40fce13e1)
2010-04-19 20:21:57 -07:00
Dan Nicholson
4e7a4bed37 Change libX11 variables to not conflict with AC_PATH_XTRA
The variable X_LIBS from AC_PATH_XTRA contains only the -L searchdir
parameter and not the -lX11 to link to Xlib. Use X11 prefixed build vars
for linking with Xlib to avoid the conflict.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
(cherry picked from commit e725ef171b)
2010-04-19 20:21:57 -07:00
Dan Nicholson
4f8bf353bd gallium: Respect user's CFLAGS for including X headers
This can break on systems that don't have a system X installation.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
(cherry picked from commit de4ee20578)

Conflicts:

	src/gallium/winsys/xlib/Makefile
2010-04-19 20:21:57 -07:00
Jeff Smith
3b693fd93f Use X_LIBS from pkg-config, instead of libdir, for locating libX11
Signed-off-by: Jeff Smith <whydoubt@yahoo.com>
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
(cherry picked from commit 8d86d395dc)
2010-04-19 20:21:57 -07:00
Jesse Barnes
0a18cdb0ed DRI2: check for swapAvailable before using swap interval protocol
This should have been part of the last change...
2010-04-19 14:20:21 -07:00
Jesse Barnes
385e2896eb DRI2: synchronize swap interval with server at startup time
In the direct rendered case, we need to tell the server our initial swap
interval.  If we don't, the local and server values will be out of sync,
since the server and client defaults may be different (as they were
before this patch).
2010-04-19 09:56:32 -07:00
Brian Paul
c060265bdb st/mesa: invert scissor rect depending on FB orientation
Fixes fd.o bug 27715
2010-04-19 10:10:47 -06:00
Matthieu Herrb
cf7d08b443 mesa: Fix build with gcc 3.3.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-19 09:33:53 -06:00
Matthieu Herrb
f4553d99c6 radeon: Let this build with gcc 3.3
Declaring the loop index inside for () is not supported by this version.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-19 09:33:53 -06:00
Owain Ainsworth
c39ab02ae9 radeon: Fix command type for DRM_RADEON_IRQ_EMIT ioctl.
This should be drmCommandWriteRead to avoid an EINVAL error on systems
that strictly check ioctl args. This command has been r/w for ever.
Discussion with airlied agreed that this was the correct course.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-19 09:33:50 -06:00
Matthieu Herrb
7f1ae3a94d mesa: Use __OpenBSD__ to check for OpenBSD.
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-04-19 09:33:42 -06:00
Brian Paul
e3a34cc7f6 gallium/draw: use correct rasterization state for wide/AA points/lines
When points or lines are decomposed into triangles, we need to be sure
to disable polygon culling, stippling, "un-filled" modes, etc.

This patch sets the rasterization state to disable those things prior to
drawing points/lines with triangles, then restores the previous state
afterward.

The new piglit point-no-line-cull test checks this problem & solution.
2010-04-19 08:35:53 -06:00
45 changed files with 301 additions and 101 deletions

View File

@@ -24,6 +24,8 @@ RADEON_CFLAGS = @RADEON_CFLAGS@
RADEON_LDFLAGS = @RADEON_LDFLAGS@
INTEL_LIBS = @INTEL_LIBS@
INTEL_CFLAGS = @INTEL_CFLAGS@
X11_LIBS = @X11_LIBS@
X11_CFLAGS = @X11_CFLAGS@
# Assembler
MESA_ASM_SOURCES = @MESA_ASM_SOURCES@

View File

@@ -119,7 +119,7 @@ APP_LIB_DEPS = $(EXTRA_LIB_PATH) -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LI
# Program dependencies - specific GL/glut libraries added in Makefiles
APP_LIB_DEPS = -lm
X11_LIBS = -lX11
# Installation directories (for make install)
INSTALL_DIR = /usr/local

View File

@@ -547,8 +547,14 @@ else
x11_pkgconfig=no
fi
dnl Use the autoconf macro if no pkg-config files
if test "$x11_pkgconfig" = no; then
if test "$x11_pkgconfig" = yes; then
PKG_CHECK_MODULES([X11], [x11])
else
AC_PATH_XTRA
test -z "$X11_CFLAGS" && X11_CFLAGS="$X_CFLAGS"
test -z "$X11_LIBS" && X11_LIBS="$X_LIBS -lX11"
AC_SUBST([X11_CFLAGS])
AC_SUBST([X11_LIBS])
fi
dnl Try to tell the user that the --x-* options are only used when

View File

@@ -158,7 +158,7 @@ static void printhelp(void)
glRasterPos2i(60,240);
printstring(GLUT_BITMAP_TIMES_ROMAN_24,"l - Increase rain length");
glRasterPos2i(60,210);
printstring(GLUT_BITMAP_TIMES_ROMAN_24,"k - Increase rain length");
printstring(GLUT_BITMAP_TIMES_ROMAN_24,"k - Decrease rain length");
}
static void drawrain(void)

View File

@@ -4,7 +4,7 @@ TOP = ../..
include $(TOP)/configs/current
INCLUDE_DIRS = -I$(TOP)/include
INCLUDE_DIRS = -I$(TOP)/include $(X11_CFLAGS)
HEADERS = $(TOP)/include/GLES/egl.h
LIB_DEP = $(TOP)/$(LIB_DIR)/libEGL.so
@@ -57,13 +57,13 @@ peglgears: peglgears.o $(HEADERS) $(LIB_DEP)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(LIBDRM_LIB) -lm
xeglgears: xeglgears.o $(HEADERS) $(LIB_DEP)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm -L$(libdir) -lX11
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm $(X11_LIBS)
xeglthreads: xeglthreads.o $(HEADERS) $(LIB_DEP)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm -L$(libdir) -lX11
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm $(X11_LIBS)
xegl_tri: xegl_tri.o $(HEADERS) $(LIB_DEP)
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm -L$(libdir) -lX11
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm $(X11_LIBS)
clean:
-rm -f *.o *~

View File

@@ -9,9 +9,9 @@ INCDIR = $(TOP)/include
LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
# Add X11 and pthread libs to satisfy GNU gold.
APP_LIB_DEPS += -lX11 -lpthread
APP_LIB_DEPS += $(X11_LIBS) -lpthread
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(libdir) $(APP_LIB_DEPS)
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(APP_LIB_DEPS)
PROGS = \
corender \

View File

@@ -10,7 +10,7 @@ EGL_INCLUDES = \
-I$(TOP)/include \
-I$(TOP)/src/egl/main
EGL_CFLAGS =
EGL_LIBS = -lX11 -lGL
EGL_CFLAGS = $(X11_CFLAGS)
EGL_LIBS = $(X11_LIBS) -lGL
include ../Makefile.template

View File

@@ -7,7 +7,7 @@ include $(TOP)/configs/current
EGL_MAJOR = 1
EGL_MINOR = 0
INCLUDE_DIRS = -I$(TOP)/include
INCLUDE_DIRS = -I$(TOP)/include $(X11_CFLAGS)
HEADERS = \
eglcompiler.h \

View File

@@ -31,6 +31,7 @@
*/
#include "pipe/p_context.h"
#include "util/u_memory.h"
#include "util/u_math.h"
#include "draw_context.h"
@@ -38,7 +39,7 @@
#include "draw_gs.h"
struct draw_context *draw_create( void )
struct draw_context *draw_create( struct pipe_context *pipe )
{
struct draw_context *draw = CALLOC_STRUCT( draw_context );
if (draw == NULL)
@@ -68,6 +69,8 @@ struct draw_context *draw_create( void )
if (!draw_gs_init( draw ))
goto fail;
draw->pipe = pipe;
return draw;
fail:
@@ -78,10 +81,21 @@ fail:
void draw_destroy( struct draw_context *draw )
{
struct pipe_context *pipe = draw->pipe;
int i, j;
if (!draw)
return;
/* free any rasterizer CSOs that we may have created.
*/
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
if (draw->rasterizer_no_cull[i][j]) {
pipe->delete_rasterizer_state(pipe, draw->rasterizer_no_cull[i][j]);
}
}
}
/* Not so fast -- we're just borrowing this at the moment.
*
@@ -123,12 +137,17 @@ void draw_set_mrd(struct draw_context *draw, double mrd)
* This causes the drawing pipeline to be rebuilt.
*/
void draw_set_rasterizer_state( struct draw_context *draw,
const struct pipe_rasterizer_state *raster )
const struct pipe_rasterizer_state *raster,
void *rast_handle )
{
draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
if (!draw->suspend_flushing) {
draw_do_flush( draw, DRAW_FLUSH_STATE_CHANGE );
draw->rasterizer = raster;
draw->bypass_clipping = draw->driver.bypass_clipping;
draw->rasterizer = raster;
draw->rast_handle = rast_handle;
draw->bypass_clipping = draw->driver.bypass_clipping;
}
}
@@ -481,3 +500,37 @@ draw_current_shader_position_output(const struct draw_context *draw)
return draw->gs.position_output;
return draw->vs.position_output;
}
/**
* Return a pointer/handle for a driver/CSO rasterizer object which
* disabled culling, stippling, unfilled tris, etc.
* This is used by some pipeline stages (such as wide_point, aa_line
* and aa_point) which convert points/lines into triangles. In those
* cases we don't want to accidentally cull the triangles.
*
* \param scissor should the rasterizer state enable scissoring?
* \param flatshade should the rasterizer state use flat shading?
* \return rasterizer CSO handle
*/
void *
draw_get_rasterizer_no_cull( struct draw_context *draw,
boolean scissor,
boolean flatshade )
{
if (!draw->rasterizer_no_cull[scissor][flatshade]) {
/* create now */
struct pipe_context *pipe = draw->pipe;
struct pipe_rasterizer_state rast;
memset(&rast, 0, sizeof(rast));
rast.scissor = scissor;
rast.flatshade = flatshade;
rast.front_winding = PIPE_WINDING_CCW;
rast.gl_rasterization_rules = draw->rasterizer->gl_rasterization_rules;
draw->rasterizer_no_cull[scissor][flatshade] =
pipe->create_rasterizer_state(pipe, &rast);
}
return draw->rasterizer_no_cull[scissor][flatshade];
}

View File

@@ -49,7 +49,7 @@ struct draw_geometry_shader;
struct tgsi_sampler;
struct draw_context *draw_create( void );
struct draw_context *draw_create( struct pipe_context *pipe );
void draw_destroy( struct draw_context *draw );
@@ -60,7 +60,8 @@ void draw_set_clip_state( struct draw_context *pipe,
const struct pipe_clip_state *clip );
void draw_set_rasterizer_state( struct draw_context *draw,
const struct pipe_rasterizer_state *raster );
const struct pipe_rasterizer_state *raster,
void *rast_handle );
void draw_set_rasterize_stage( struct draw_context *draw,
struct draw_stage *stage );

View File

@@ -113,8 +113,6 @@ struct aaline_stage
void **);
void (*driver_set_sampler_textures)(struct pipe_context *, unsigned,
struct pipe_texture **);
struct pipe_context *pipe;
};
@@ -339,6 +337,7 @@ aa_transform_inst(struct tgsi_transform_context *ctx,
static boolean
generate_aaline_fs(struct aaline_stage *aaline)
{
struct pipe_context *pipe = aaline->stage.draw->pipe;
const struct pipe_shader_state *orig_fs = &aaline->fs->state;
struct pipe_shader_state aaline_fs;
struct aa_transform_context transform;
@@ -371,7 +370,7 @@ generate_aaline_fs(struct aaline_stage *aaline)
aaline->fs->sampler_unit = transform.freeSampler;
aaline->fs->aaline_fs
= aaline->driver_create_fs_state(aaline->pipe, &aaline_fs);
= aaline->driver_create_fs_state(pipe, &aaline_fs);
if (aaline->fs->aaline_fs == NULL)
goto fail;
@@ -391,7 +390,7 @@ fail:
static boolean
aaline_create_texture(struct aaline_stage *aaline)
{
struct pipe_context *pipe = aaline->pipe;
struct pipe_context *pipe = aaline->stage.draw->pipe;
struct pipe_screen *screen = pipe->screen;
struct pipe_texture texTemp;
uint level;
@@ -464,7 +463,7 @@ static boolean
aaline_create_sampler(struct aaline_stage *aaline)
{
struct pipe_sampler_state sampler;
struct pipe_context *pipe = aaline->pipe;
struct pipe_context *pipe = aaline->stage.draw->pipe;
memset(&sampler, 0, sizeof(sampler));
sampler.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE;
@@ -493,13 +492,14 @@ static boolean
bind_aaline_fragment_shader(struct aaline_stage *aaline)
{
struct draw_context *draw = aaline->stage.draw;
struct pipe_context *pipe = draw->pipe;
if (!aaline->fs->aaline_fs &&
!generate_aaline_fs(aaline))
return FALSE;
draw->suspend_flushing = TRUE;
aaline->driver_bind_fs_state(aaline->pipe, aaline->fs->aaline_fs);
aaline->driver_bind_fs_state(pipe, aaline->fs->aaline_fs);
draw->suspend_flushing = FALSE;
return TRUE;
@@ -639,8 +639,10 @@ aaline_first_line(struct draw_stage *stage, struct prim_header *header)
{
auto struct aaline_stage *aaline = aaline_stage(stage);
struct draw_context *draw = stage->draw;
struct pipe_context *pipe = aaline->pipe;
struct pipe_context *pipe = draw->pipe;
const struct pipe_rasterizer_state *rast = draw->rasterizer;
uint num_samplers;
void *r;
assert(draw->rasterizer->line_smooth);
@@ -679,6 +681,11 @@ aaline_first_line(struct draw_stage *stage, struct prim_header *header)
draw->suspend_flushing = TRUE;
aaline->driver_bind_sampler_states(pipe, num_samplers, aaline->state.sampler);
aaline->driver_set_sampler_textures(pipe, num_samplers, aaline->state.texture);
/* Disable triangle culling, stippling, unfilled mode etc. */
r = draw_get_rasterizer_no_cull(draw, rast->scissor, rast->flatshade);
pipe->bind_rasterizer_state(pipe, r);
draw->suspend_flushing = FALSE;
/* now really draw first line */
@@ -692,7 +699,7 @@ aaline_flush(struct draw_stage *stage, unsigned flags)
{
struct draw_context *draw = stage->draw;
struct aaline_stage *aaline = aaline_stage(stage);
struct pipe_context *pipe = aaline->pipe;
struct pipe_context *pipe = draw->pipe;
stage->line = aaline_first_line;
stage->next->flush( stage->next, flags );
@@ -704,6 +711,12 @@ aaline_flush(struct draw_stage *stage, unsigned flags)
aaline->state.sampler);
aaline->driver_set_sampler_textures(pipe, aaline->num_textures,
aaline->state.texture);
/* restore original rasterizer state */
if (draw->rast_handle) {
pipe->bind_rasterizer_state(pipe, draw->rast_handle);
}
draw->suspend_flushing = FALSE;
draw->extra_shader_outputs.slot = 0;
@@ -721,6 +734,7 @@ static void
aaline_destroy(struct draw_stage *stage)
{
struct aaline_stage *aaline = aaline_stage(stage);
struct pipe_context *pipe = stage->draw->pipe;
uint i;
for (i = 0; i < PIPE_MAX_SAMPLERS; i++) {
@@ -728,7 +742,7 @@ aaline_destroy(struct draw_stage *stage)
}
if (aaline->sampler_cso)
aaline->pipe->delete_sampler_state(aaline->pipe, aaline->sampler_cso);
pipe->delete_sampler_state(pipe, aaline->sampler_cso);
if (aaline->texture)
pipe_texture_reference(&aaline->texture, NULL);
@@ -787,13 +801,14 @@ aaline_create_fs_state(struct pipe_context *pipe,
{
struct aaline_stage *aaline = aaline_stage_from_pipe(pipe);
struct aaline_fragment_shader *aafs = CALLOC_STRUCT(aaline_fragment_shader);
if (aafs == NULL)
return NULL;
aafs->state = *fs;
/* pass-through */
aafs->driver_fs = aaline->driver_create_fs_state(aaline->pipe, fs);
aafs->driver_fs = aaline->driver_create_fs_state(pipe, fs);
return aafs;
}
@@ -808,8 +823,7 @@ aaline_bind_fs_state(struct pipe_context *pipe, void *fs)
/* save current */
aaline->fs = aafs;
/* pass-through */
aaline->driver_bind_fs_state(aaline->pipe,
(aafs ? aafs->driver_fs : NULL));
aaline->driver_bind_fs_state(pipe, (aafs ? aafs->driver_fs : NULL));
}
@@ -818,11 +832,12 @@ aaline_delete_fs_state(struct pipe_context *pipe, void *fs)
{
struct aaline_stage *aaline = aaline_stage_from_pipe(pipe);
struct aaline_fragment_shader *aafs = (struct aaline_fragment_shader *) fs;
/* pass-through */
aaline->driver_delete_fs_state(aaline->pipe, aafs->driver_fs);
aaline->driver_delete_fs_state(pipe, aafs->driver_fs);
if (aafs->aaline_fs)
aaline->driver_delete_fs_state(aaline->pipe, aafs->aaline_fs);
aaline->driver_delete_fs_state(pipe, aafs->aaline_fs);
FREE(aafs);
}
@@ -839,7 +854,7 @@ aaline_bind_sampler_states(struct pipe_context *pipe,
aaline->num_samplers = num;
/* pass-through */
aaline->driver_bind_sampler_states(aaline->pipe, num, sampler);
aaline->driver_bind_sampler_states(pipe, num, sampler);
}
@@ -860,7 +875,7 @@ aaline_set_sampler_textures(struct pipe_context *pipe,
aaline->num_textures = num;
/* pass-through */
aaline->driver_set_sampler_textures(aaline->pipe, num, texture);
aaline->driver_set_sampler_textures(pipe, num, texture);
}
@@ -883,8 +898,6 @@ draw_install_aaline_stage(struct draw_context *draw, struct pipe_context *pipe)
if (!aaline)
goto fail;
aaline->pipe = pipe;
/* create special texture, sampler state */
if (!aaline_create_texture(aaline))
goto fail;

View File

@@ -107,8 +107,6 @@ struct aapoint_stage
const struct pipe_shader_state *);
void (*driver_bind_fs_state)(struct pipe_context *, void *);
void (*driver_delete_fs_state)(struct pipe_context *, void *);
struct pipe_context *pipe;
};
@@ -499,6 +497,7 @@ generate_aapoint_fs(struct aapoint_stage *aapoint)
struct pipe_shader_state aapoint_fs;
struct aa_transform_context transform;
const uint newLen = tgsi_num_tokens(orig_fs->tokens) + NUM_NEW_TOKENS;
struct pipe_context *pipe = aapoint->stage.draw->pipe;
aapoint_fs = *orig_fs; /* copy to init */
aapoint_fs.tokens = tgsi_alloc_tokens(newLen);
@@ -527,7 +526,7 @@ generate_aapoint_fs(struct aapoint_stage *aapoint)
#endif
aapoint->fs->aapoint_fs
= aapoint->driver_create_fs_state(aapoint->pipe, &aapoint_fs);
= aapoint->driver_create_fs_state(pipe, &aapoint_fs);
if (aapoint->fs->aapoint_fs == NULL)
goto fail;
@@ -549,13 +548,14 @@ static boolean
bind_aapoint_fragment_shader(struct aapoint_stage *aapoint)
{
struct draw_context *draw = aapoint->stage.draw;
struct pipe_context *pipe = draw->pipe;
if (!aapoint->fs->aapoint_fs &&
!generate_aapoint_fs(aapoint))
return FALSE;
draw->suspend_flushing = TRUE;
aapoint->driver_bind_fs_state(aapoint->pipe, aapoint->fs->aapoint_fs);
aapoint->driver_bind_fs_state(pipe, aapoint->fs->aapoint_fs);
draw->suspend_flushing = FALSE;
return TRUE;
@@ -679,6 +679,9 @@ aapoint_first_point(struct draw_stage *stage, struct prim_header *header)
{
auto struct aapoint_stage *aapoint = aapoint_stage(stage);
struct draw_context *draw = stage->draw;
struct pipe_context *pipe = draw->pipe;
const struct pipe_rasterizer_state *rast = draw->rasterizer;
void *r;
assert(draw->rasterizer->point_smooth);
@@ -716,6 +719,14 @@ aapoint_first_point(struct draw_stage *stage, struct prim_header *header)
}
}
draw->suspend_flushing = TRUE;
/* Disable triangle culling, stippling, unfilled mode etc. */
r = draw_get_rasterizer_no_cull(draw, rast->scissor, rast->flatshade);
pipe->bind_rasterizer_state(pipe, r);
draw->suspend_flushing = FALSE;
/* now really draw first point */
stage->point = aapoint_point;
stage->point(stage, header);
@@ -727,7 +738,7 @@ aapoint_flush(struct draw_stage *stage, unsigned flags)
{
struct draw_context *draw = stage->draw;
struct aapoint_stage *aapoint = aapoint_stage(stage);
struct pipe_context *pipe = aapoint->pipe;
struct pipe_context *pipe = draw->pipe;
stage->point = aapoint_first_point;
stage->next->flush( stage->next, flags );
@@ -735,6 +746,12 @@ aapoint_flush(struct draw_stage *stage, unsigned flags)
/* restore original frag shader */
draw->suspend_flushing = TRUE;
aapoint->driver_bind_fs_state(pipe, aapoint->fs->driver_fs);
/* restore original rasterizer state */
if (draw->rast_handle) {
pipe->bind_rasterizer_state(pipe, draw->rast_handle);
}
draw->suspend_flushing = FALSE;
draw->extra_shader_outputs.slot = 0;
@@ -811,7 +828,7 @@ aapoint_create_fs_state(struct pipe_context *pipe,
aafs->state = *fs;
/* pass-through */
aafs->driver_fs = aapoint->driver_create_fs_state(aapoint->pipe, fs);
aafs->driver_fs = aapoint->driver_create_fs_state(pipe, fs);
return aafs;
}
@@ -825,7 +842,7 @@ aapoint_bind_fs_state(struct pipe_context *pipe, void *fs)
/* save current */
aapoint->fs = aafs;
/* pass-through */
aapoint->driver_bind_fs_state(aapoint->pipe,
aapoint->driver_bind_fs_state(pipe,
(aafs ? aafs->driver_fs : NULL));
}
@@ -837,10 +854,10 @@ aapoint_delete_fs_state(struct pipe_context *pipe, void *fs)
struct aapoint_fragment_shader *aafs = (struct aapoint_fragment_shader *) fs;
/* pass-through */
aapoint->driver_delete_fs_state(aapoint->pipe, aafs->driver_fs);
aapoint->driver_delete_fs_state(pipe, aafs->driver_fs);
if (aafs->aapoint_fs)
aapoint->driver_delete_fs_state(aapoint->pipe, aafs->aapoint_fs);
aapoint->driver_delete_fs_state(pipe, aafs->aapoint_fs);
FREE(aafs);
}
@@ -857,8 +874,6 @@ draw_install_aapoint_stage(struct draw_context *draw,
{
struct aapoint_stage *aapoint;
pipe->draw = (void *) draw;
/*
* Create / install AA point drawing / prim stage
*/
@@ -866,8 +881,6 @@ draw_install_aapoint_stage(struct draw_context *draw,
if (aapoint == NULL)
return FALSE;
aapoint->pipe = pipe;
/* save original driver functions */
aapoint->driver_create_fs_state = pipe->create_fs_state;
aapoint->driver_bind_fs_state = pipe->bind_fs_state;

View File

@@ -28,6 +28,7 @@
/* Authors: Keith Whitwell <keith@tungstengraphics.com>
*/
#include "pipe/p_context.h"
#include "pipe/p_defines.h"
#include "pipe/p_shader_tokens.h"
#include "util/u_math.h"
@@ -142,9 +143,40 @@ static void wideline_line( struct draw_stage *stage,
}
static void wideline_first_line( struct draw_stage *stage,
struct prim_header *header )
{
struct draw_context *draw = stage->draw;
struct pipe_context *pipe = draw->pipe;
const struct pipe_rasterizer_state *rast = draw->rasterizer;
void *r;
/* Disable triangle culling, stippling, unfilled mode etc. */
r = draw_get_rasterizer_no_cull(draw, rast->scissor, rast->flatshade);
draw->suspend_flushing = TRUE;
pipe->bind_rasterizer_state(pipe, r);
draw->suspend_flushing = FALSE;
stage->line = wideline_line;
wideline_line(stage, header);
}
static void wideline_flush( struct draw_stage *stage, unsigned flags )
{
struct draw_context *draw = stage->draw;
struct pipe_context *pipe = draw->pipe;
stage->line = wideline_first_line;
stage->next->flush( stage->next, flags );
/* restore original rasterizer state */
if (draw->rast_handle) {
draw->suspend_flushing = TRUE;
pipe->bind_rasterizer_state(pipe, draw->rast_handle);
draw->suspend_flushing = FALSE;
}
}
@@ -171,7 +203,7 @@ struct draw_stage *draw_wide_line_stage( struct draw_context *draw )
wide->stage.name = "wide-line";
wide->stage.next = NULL;
wide->stage.point = draw_pipe_passthrough_point;
wide->stage.line = wideline_line;
wide->stage.line = wideline_first_line;
wide->stage.tri = draw_pipe_passthrough_tri;
wide->stage.flush = wideline_flush;
wide->stage.reset_stipple_counter = wideline_reset_stipple_counter;

View File

@@ -52,6 +52,7 @@
*/
#include "pipe/p_context.h"
#include "util/u_math.h"
#include "util/u_memory.h"
#include "pipe/p_defines.h"
@@ -213,6 +214,9 @@ static void widepoint_first_point( struct draw_stage *stage,
{
struct widepoint_stage *wide = widepoint_stage(stage);
struct draw_context *draw = stage->draw;
struct pipe_context *pipe = draw->pipe;
const struct pipe_rasterizer_state *rast = draw->rasterizer;
void *r;
wide->half_point_size = 0.5f * draw->rasterizer->point_size;
wide->xbias = 0.0;
@@ -222,6 +226,12 @@ static void widepoint_first_point( struct draw_stage *stage,
wide->xbias = 0.125;
}
/* Disable triangle culling, stippling, unfilled mode etc. */
r = draw_get_rasterizer_no_cull(draw, rast->scissor, rast->flatshade);
draw->suspend_flushing = TRUE;
pipe->bind_rasterizer_state(pipe, r);
draw->suspend_flushing = FALSE;
/* XXX we won't know the real size if it's computed by the vertex shader! */
if ((draw->rasterizer->point_size > draw->pipeline.wide_point_threshold) ||
(draw->rasterizer->sprite_coord_enable && draw->pipeline.point_sprite)) {
@@ -277,9 +287,19 @@ static void widepoint_first_point( struct draw_stage *stage,
static void widepoint_flush( struct draw_stage *stage, unsigned flags )
{
struct draw_context *draw = stage->draw;
struct pipe_context *pipe = draw->pipe;
stage->point = widepoint_first_point;
stage->next->flush( stage->next, flags );
stage->draw->extra_shader_outputs.slot = 0;
/* restore original rasterizer state */
if (draw->rast_handle) {
draw->suspend_flushing = TRUE;
pipe->bind_rasterizer_state(pipe, draw->rast_handle);
draw->suspend_flushing = FALSE;
}
}

View File

@@ -82,6 +82,8 @@ struct vertex_header {
*/
struct draw_context
{
struct pipe_context *pipe;
/** Drawing/primitive pipeline stages */
struct {
struct draw_stage *first; /**< one of the following */
@@ -174,8 +176,14 @@ struct draw_context
double mrd; /**< minimum resolvable depth value, for polygon offset */
/* pipe state that we need: */
/** Current rasterizer state given to us by the driver */
const struct pipe_rasterizer_state *rasterizer;
/** Driver CSO handle for the current rasterizer state */
void *rast_handle;
/** Rasterizer CSOs without culling/stipple/etc */
void *rasterizer_no_cull[2][2];
struct pipe_viewport_state viewport;
boolean identity_viewport;
@@ -345,5 +353,10 @@ void draw_do_flush( struct draw_context *draw, unsigned flags );
void *
draw_get_rasterizer_no_cull( struct draw_context *draw,
boolean scissor,
boolean flatshade );
#endif /* DRAW_PRIVATE_H */

View File

@@ -210,7 +210,7 @@ i915_create_context(struct pipe_screen *screen, void *priv)
/*
* Create drawing context and plug our rendering stage into it.
*/
i915->draw = draw_create();
i915->draw = draw_create(&i915->base);
assert(i915->draw);
if (!debug_get_bool_option("I915_NO_VBUF", FALSE)) {
draw_set_rasterize_stage(i915->draw, i915_draw_vbuf_stage(i915));

View File

@@ -714,7 +714,8 @@ static void i915_bind_rasterizer_state( struct pipe_context *pipe,
/* pass-through to draw module */
draw_set_rasterizer_state(i915->draw,
(i915->rasterizer ? i915->rasterizer->templ : NULL));
(i915->rasterizer ? i915->rasterizer->templ : NULL),
raster);
i915->dirty |= I915_NEW_RASTERIZER;
}

View File

@@ -174,7 +174,7 @@ llvmpipe_create_context( struct pipe_screen *screen, void *priv )
/*
* Create drawing context and plug our rendering stage into it.
*/
llvmpipe->draw = draw_create();
llvmpipe->draw = draw_create(&llvmpipe->pipe);
if (!llvmpipe->draw)
goto fail;

View File

@@ -38,19 +38,26 @@ void *
llvmpipe_create_rasterizer_state(struct pipe_context *pipe,
const struct pipe_rasterizer_state *rast)
{
/* We do nothing special with rasterizer state.
* The CSO handle is just a pointer to a pipe_rasterizer_state object.
*/
return mem_dup(rast, sizeof(*rast));
}
void llvmpipe_bind_rasterizer_state(struct pipe_context *pipe,
void *rasterizer)
void
llvmpipe_bind_rasterizer_state(struct pipe_context *pipe, void *handle)
{
struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
const struct pipe_rasterizer_state *rasterizer =
(const struct pipe_rasterizer_state *) handle;
if (llvmpipe->rasterizer == rasterizer)
return;
/* pass-through to draw module */
draw_set_rasterizer_state(llvmpipe->draw, rasterizer);
draw_set_rasterizer_state(llvmpipe->draw, rasterizer, handle);
llvmpipe->rasterizer = rasterizer;
@@ -68,6 +75,7 @@ void llvmpipe_bind_rasterizer_state(struct pipe_context *pipe,
llvmpipe->dirty |= LP_NEW_RASTERIZER;
}
void llvmpipe_delete_rasterizer_state(struct pipe_context *pipe,
void *rasterizer)
{

View File

@@ -129,7 +129,7 @@ nv50_create(struct pipe_screen *pscreen, void *priv)
nv50_init_state_functions(nv50);
nv50_init_query_functions(nv50);
nv50->draw = draw_create();
nv50->draw = draw_create(&nv50->pipe);
assert(nv50->draw);
draw_set_rasterize_stage(nv50->draw, nv50_draw_render_stage(nv50));

View File

@@ -181,7 +181,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
r300->context.draw_range_elements = r300_swtcl_draw_range_elements;
/* Create a Draw. This is used for SW TCL. */
r300->draw = draw_create();
r300->draw = draw_create(&r300->context);
/* Enable our renderer. */
draw_set_rasterize_stage(r300->draw, r300_draw_stage(r300));
/* Enable Draw's clipping. */

View File

@@ -810,7 +810,7 @@ static void r300_bind_rs_state(struct pipe_context* pipe, void* state)
if (r300->draw) {
draw_flush(r300->draw);
draw_set_rasterizer_state(r300->draw, &rs->rs);
draw_set_rasterizer_state(r300->draw, &rs->rs, state);
}
if (rs) {

View File

@@ -298,7 +298,7 @@ softpipe_create_context( struct pipe_screen *screen,
/*
* Create drawing context and plug our rendering stage into it.
*/
softpipe->draw = draw_create();
softpipe->draw = draw_create(&softpipe->pipe);
if (!softpipe->draw)
goto fail;

View File

@@ -49,7 +49,7 @@ void softpipe_bind_rasterizer_state(struct pipe_context *pipe,
return;
/* pass-through to draw module */
draw_set_rasterizer_state(softpipe->draw, rasterizer);
draw_set_rasterizer_state(softpipe->draw, rasterizer, rasterizer);
softpipe->rasterizer = rasterizer;

View File

@@ -222,7 +222,8 @@ static void svga_bind_rasterizer_state( struct pipe_context *pipe,
svga->curr.rast = raster;
draw_set_rasterizer_state(svga->swtnl.draw, raster ? &raster->templ : NULL);
draw_set_rasterizer_state(svga->swtnl.draw, raster ? &raster->templ : NULL,
state);
svga->dirty |= SVGA_NEW_RAST;
}

View File

@@ -134,7 +134,7 @@ boolean svga_init_swtnl( struct svga_context *svga )
/*
* Create drawing context and plug our rendering stage into it.
*/
svga->swtnl.draw = draw_create();
svga->swtnl.draw = draw_create(&svga->pipe);
if (svga->swtnl.draw == NULL)
goto fail;

View File

@@ -113,7 +113,8 @@ static int update_swtnl_draw( struct svga_context *svga,
if (dirty & SVGA_NEW_RAST)
draw_set_rasterizer_state(svga->swtnl.draw,
&svga->curr.rast->templ);
&svga->curr.rast->templ,
(void *) svga->curr.rast);
if (dirty & SVGA_NEW_FRAME_BUFFER)
draw_set_mrd(svga->swtnl.draw,

View File

@@ -16,6 +16,7 @@ x11_INCLUDES = \
-I$(TOP)/src/gallium/drivers \
-I$(TOP)/src/glx \
-I$(TOP)/src/mesa \
$(X11_CFLAGS) \
$(shell pkg-config --cflags-only-I libdrm)
x11_SOURCES = $(wildcard x11/*.c) \

View File

@@ -5,7 +5,8 @@ LIBNAME = xlib
LIBRARY_INCLUDES = \
-I$(TOP)/include \
-I$(TOP)/src/mesa
-I$(TOP)/src/mesa \
$(X11_CFLAGS)
C_SOURCES = \
glx_api.c \

View File

@@ -20,7 +20,8 @@ INCLUDE_DIRS = \
-I$(TOP)/src/gallium/include \
-I$(TOP)/src/gallium/drivers \
-I$(TOP)/src/gallium/state_trackers/glx/xlib \
-I$(TOP)/src/gallium/auxiliary
-I$(TOP)/src/gallium/auxiliary \
$(X11_CFLAGS)
DEFINES += \
-DGALLIUM_SOFTPIPE

View File

@@ -175,6 +175,8 @@ dri2CreateDrawable(__GLXscreenConfigs * psc,
{
__GLXDRIdrawablePrivate *pdraw;
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) modes;
__GLXdisplayPrivate *dpyPriv;
__GLXDRIdisplayPrivate *pdp;
pdraw = Xmalloc(sizeof(*pdraw));
if (!pdraw)
@@ -185,10 +187,12 @@ dri2CreateDrawable(__GLXscreenConfigs * psc,
pdraw->base.drawable = drawable;
pdraw->base.psc = psc;
pdraw->bufferCount = 0;
pdraw->swap_interval = 0;
pdraw->swap_interval = 1;
DRI2CreateDrawable(psc->dpy, xDrawable);
dpyPriv = __glXInitialize(psc->dpy);
pdp = (__GLXDRIdisplayPrivate *)dpyPriv->dri2Display;;
/* Create a new drawable */
pdraw->base.driDrawable =
(*psc->dri2->createNewDrawable) (psc->__driScreen,
@@ -200,6 +204,15 @@ dri2CreateDrawable(__GLXscreenConfigs * psc,
return NULL;
}
#ifdef X_DRI2SwapInterval
/*
* Make sure server has the same swap interval we do for the new
* drawable.
*/
if (pdp->swapAvailable)
DRI2SwapInterval(psc->dpy, xDrawable, pdraw->swap_interval);
#endif
return &pdraw->base;
}

View File

@@ -539,6 +539,8 @@ __glXInitializeVisualConfigFromTags(__GLcontextModes * config, int count,
i = count;
break;
default:
/* Ignore the unrecognized tag's value */
bp++;
break;
}
}

View File

@@ -65,7 +65,7 @@ extern char *program_invocation_name, *program_invocation_short_name;
#endif
#if !defined(GET_PROGRAM_NAME)
# if defined(OpenBSD) || defined(NetBSD) || defined(__UCLIBC__)
# if defined(__OpenBSD__) || defined(NetBSD) || defined(__UCLIBC__)
/* This is a hack. It's said to work on OpenBSD, NetBSD and GNU.
* Rogelio M.Serrano Jr. reported it's also working with UCLIBC. It's
* used as a last resort, if there is no documented facility available. */

View File

@@ -1658,20 +1658,21 @@ void r300VapCntl(r300ContextPtr rmesa, GLuint input_count,
(5 << R300_PVS_NUM_CNTLRS_SHIFT) |
(5 << R300_VF_MAX_VTX_NUM_SHIFT));
if (rmesa->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV515)
rmesa->hw.vap_cntl.cmd[R300_VAP_CNTL_INSTR] |= (2 << R300_PVS_NUM_FPUS_SHIFT);
else if ((rmesa->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV530) ||
(rmesa->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV560) ||
(rmesa->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV570))
if ((rmesa->radeon.radeonScreen->chip_family == CHIP_FAMILY_R300) ||
(rmesa->radeon.radeonScreen->chip_family == CHIP_FAMILY_R350))
rmesa->hw.vap_cntl.cmd[R300_VAP_CNTL_INSTR] |= (4 << R300_PVS_NUM_FPUS_SHIFT);
else if (rmesa->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV530)
rmesa->hw.vap_cntl.cmd[R300_VAP_CNTL_INSTR] |= (5 << R300_PVS_NUM_FPUS_SHIFT);
else if ((rmesa->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV410) ||
(rmesa->radeon.radeonScreen->chip_family == CHIP_FAMILY_R420))
rmesa->hw.vap_cntl.cmd[R300_VAP_CNTL_INSTR] |= (6 << R300_PVS_NUM_FPUS_SHIFT);
else if ((rmesa->radeon.radeonScreen->chip_family == CHIP_FAMILY_R520) ||
(rmesa->radeon.radeonScreen->chip_family == CHIP_FAMILY_R580))
(rmesa->radeon.radeonScreen->chip_family == CHIP_FAMILY_R580) ||
(rmesa->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV560) ||
(rmesa->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV570))
rmesa->hw.vap_cntl.cmd[R300_VAP_CNTL_INSTR] |= (8 << R300_PVS_NUM_FPUS_SHIFT);
else
rmesa->hw.vap_cntl.cmd[R300_VAP_CNTL_INSTR] |= (4 << R300_PVS_NUM_FPUS_SHIFT);
rmesa->hw.vap_cntl.cmd[R300_VAP_CNTL_INSTR] |= (2 << R300_PVS_NUM_FPUS_SHIFT);
}

View File

@@ -252,12 +252,15 @@ void r700UpdateShaderStates(GLcontext * ctx)
static void r700SetDepthState(GLcontext * ctx)
{
struct radeon_renderbuffer *rrb;
context_t *context = R700_CONTEXT(ctx);
R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw);
R600_STATECHANGE(context, db);
if (ctx->Depth.Test)
rrb = radeon_get_depthbuffer(&context->radeon);
if (ctx->Depth.Test && rrb && rrb->bo)
{
SETbit(r700->DB_DEPTH_CONTROL.u32All, Z_ENABLE_bit);
if (ctx->Depth.Mask)

View File

@@ -326,7 +326,7 @@ static int cs_emit(struct radeon_cs_int *cs)
(!IS_R600_CLASS(csm->ctx->radeonScreen))) { /* +r6/r7 : No irq for r6/r7 yet. */
drm_radeon_irq_emit_t emit_cmd;
emit_cmd.irq_seq = (int*)&csm->pending_age;
r = drmCommandWrite(cs->csm->fd, DRM_RADEON_IRQ_EMIT, &emit_cmd, sizeof(emit_cmd));
r = drmCommandWriteRead(cs->csm->fd, DRM_RADEON_IRQ_EMIT, &emit_cmd, sizeof(emit_cmd));
if (r) {
return r;
}

View File

@@ -512,8 +512,10 @@ static radeon_mipmap_tree * get_biggest_matching_miptree(radeonTexObj *texObj,
unsigned mtCount = 0;
unsigned maxMtIndex = 0;
radeon_mipmap_tree *tmp;
unsigned int level;
int i;
for (unsigned level = firstLevel; level <= lastLevel; ++level) {
for (level = firstLevel; level <= lastLevel; ++level) {
radeon_texture_image *img = get_radeon_texture_image(texObj->base.Image[0][level]);
unsigned found = 0;
// TODO: why this hack??
@@ -523,7 +525,7 @@ static radeon_mipmap_tree * get_biggest_matching_miptree(radeonTexObj *texObj,
if (!img->mt)
continue;
for (int i = 0; i < mtCount; ++i) {
for (i = 0; i < mtCount; ++i) {
if (mts[i] == img->mt) {
found = 1;
mtSizes[i] += img->mt->levels[img->mtlevel].size;
@@ -544,7 +546,7 @@ static radeon_mipmap_tree * get_biggest_matching_miptree(radeonTexObj *texObj,
return NULL;
}
for (int i = 1; i < mtCount; ++i) {
for (i = 1; i < mtCount; ++i) {
if (mtSizes[i] > mtSizes[maxMtIndex]) {
maxMtIndex = i;
}

View File

@@ -1136,6 +1136,7 @@ radeonCreateScreen( __DRIscreen *sPriv )
/* pipe overrides */
switch (dri_priv->deviceID) {
case PCI_CHIP_R300_AD: /* 9500 with 1 quadpipe verified by: Reid Linnemann <lreid@cs.okstate.edu> */
case PCI_CHIP_R350_AH: /* 9800 SE only have 1 quadpipe */
case PCI_CHIP_RV410_5E4C: /* RV410 SE only have 1 quadpipe */
case PCI_CHIP_RV410_5E4F: /* RV410 SE only have 1 quadpipe */
screen->num_gb_pipes = 1;
@@ -1343,6 +1344,7 @@ radeonCreateScreen2(__DRIscreen *sPriv)
/* pipe overrides */
switch (device_id) {
case PCI_CHIP_R300_AD: /* 9500 with 1 quadpipe verified by: Reid Linnemann <lreid@cs.okstate.edu> */
case PCI_CHIP_R350_AH: /* 9800 SE only have 1 quadpipe */
case PCI_CHIP_RV410_5E4C: /* RV410 SE only have 1 quadpipe */
case PCI_CHIP_RV410_5E4F: /* RV410 SE only have 1 quadpipe */
screen->num_gb_pipes = 1;

View File

@@ -564,7 +564,8 @@ _mesa_ffsll(int64_t val)
unsigned int
_mesa_bitcount(unsigned int n)
{
#if defined(__GNUC__)
#if defined(__GNUC__) && \
((_GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4)
return __builtin_popcount(n);
#else
unsigned int bits;

View File

@@ -404,7 +404,8 @@ _mesa_is_pow_two(int x)
static INLINE int32_t
_mesa_next_pow_two_32(uint32_t x)
{
#ifdef __GNUC__
#if defined(__GNUC__) && \
((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4)
uint32_t y = (x != 1);
return (1 + y) << ((__builtin_clz(x - y) ^ 31) );
#else
@@ -422,7 +423,8 @@ _mesa_next_pow_two_32(uint32_t x)
static INLINE int64_t
_mesa_next_pow_two_64(uint64_t x)
{
#ifdef __GNUC__
#if defined(__GNUC__) && \
((__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || __GNUC__ >= 4)
uint64_t y = (x != 1);
if (sizeof(x) == sizeof(long))
return (1 + y) << ((__builtin_clzl(x - y) ^ 63));

View File

@@ -1215,10 +1215,10 @@ static void FETCH(signed_rgba8888)( const struct gl_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel )
{
const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
texel[RCOMP] = BYTE_TO_FLOAT_TEX( (s >> 24) );
texel[GCOMP] = BYTE_TO_FLOAT_TEX( (s >> 16) & 0xff );
texel[BCOMP] = BYTE_TO_FLOAT_TEX( (s >> 8) & 0xff );
texel[ACOMP] = BYTE_TO_FLOAT_TEX( (s ) & 0xff );
texel[RCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 24) );
texel[GCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 16) );
texel[BCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 8) );
texel[ACOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s ) );
}
#if DIM == 3
@@ -1235,10 +1235,10 @@ static void FETCH(signed_rgba8888_rev)( const struct gl_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel )
{
const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
texel[RCOMP] = BYTE_TO_FLOAT_TEX( (s ) & 0xff );
texel[GCOMP] = BYTE_TO_FLOAT_TEX( (s >> 8) & 0xff );
texel[BCOMP] = BYTE_TO_FLOAT_TEX( (s >> 16) & 0xff );
texel[ACOMP] = BYTE_TO_FLOAT_TEX( (s >> 24) );
texel[RCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s ) );
texel[GCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 8) );
texel[BCOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 16) );
texel[ACOMP] = BYTE_TO_FLOAT_TEX( (GLbyte) (s >> 24) );
}
#if DIM == 3

View File

@@ -72,12 +72,15 @@ update_scissor( struct st_context *st )
scissor.minx = scissor.miny = scissor.maxx = scissor.maxy = 0;
}
/* Now invert Y. Pipe drivers use the convention Y=0=top for surfaces
/* Now invert Y if needed.
* Gallium drivers use the convention Y=0=top for surfaces.
*/
miny = fb->Height - scissor.maxy;
maxy = fb->Height - scissor.miny;
scissor.miny = miny;
scissor.maxy = maxy;
if (st_fb_orientation(fb) == Y_0_TOP) {
miny = fb->Height - scissor.maxy;
maxy = fb->Height - scissor.miny;
scissor.miny = miny;
scissor.maxy = maxy;
}
if (memcmp(&scissor, &st->state.scissor, sizeof(scissor)) != 0) {
/* state has changed */

View File

@@ -115,7 +115,7 @@ st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe )
_vbo_CreateContext(ctx);
#if FEATURE_feedback || FEATURE_drawpix
st->draw = draw_create(); /* for selection/feedback */
st->draw = draw_create(pipe); /* for selection/feedback */
/* Disable draw options that might convert points/lines to tris, etc.
* as that would foul-up feedback/selection mode.

View File

@@ -134,7 +134,7 @@ st_feedback_draw_vbo(GLcontext *ctx,
assert(draw);
draw_set_viewport_state(draw, &st->state.viewport);
draw_set_clip_state(draw, &st->state.clip);
draw_set_rasterizer_state(draw, &st->state.rasterizer);
draw_set_rasterizer_state(draw, &st->state.rasterizer, NULL);
draw_bind_vertex_shader(draw, st->vp_varient->draw_shader);
set_feedback_vertex_format(ctx);

View File

@@ -154,6 +154,10 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat)
return PIPE_FORMAT_S8Z24_UNORM;
case MESA_FORMAT_S8_Z24:
return PIPE_FORMAT_Z24S8_UNORM;
case MESA_FORMAT_Z24_X8:
return PIPE_FORMAT_X8Z24_UNORM;
case MESA_FORMAT_X8_Z24:
return PIPE_FORMAT_Z24X8_UNORM;
case MESA_FORMAT_YCBCR:
return PIPE_FORMAT_UYVY;
#if FEATURE_texture_s3tc