Compare commits
39 Commits
mesa-7.8.1
...
7.8-branch
Author | SHA1 | Date | |
---|---|---|---|
|
ad7d36e919 | ||
|
eb4dc54788 | ||
|
c37e275e77 | ||
|
355370e30b | ||
|
b1a9c76b57 | ||
|
4d7ef6e06b | ||
|
986eb4b99f | ||
|
2e995cdf25 | ||
|
88be2171e7 | ||
|
8e5effefc7 | ||
|
4e7a4bed37 | ||
|
4f8bf353bd | ||
|
3b693fd93f | ||
|
0a18cdb0ed | ||
|
385e2896eb | ||
|
c060265bdb | ||
|
cf7d08b443 | ||
|
f4553d99c6 | ||
|
c39ab02ae9 | ||
|
7f1ae3a94d | ||
|
e3a34cc7f6 | ||
|
db3b34219e | ||
|
885048232f | ||
|
b3a68cdc6f | ||
|
d9793fc3ac | ||
|
157bdd1446 | ||
|
497b66094d | ||
|
4a796264df | ||
|
2657325c4a | ||
|
6a5518861e | ||
|
edff2e0585 | ||
|
394c25133e | ||
|
b22a00bff4 | ||
|
21cf976ad9 | ||
|
3ad9a98ec2 | ||
|
ffedd28c9c | ||
|
bab6c0a035 | ||
|
8ac7d7fa05 | ||
|
4b39a0da89 |
@@ -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@
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -13,14 +13,14 @@
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-users"
|
||||
target="_parent">mesa3d-users</a> - intended for end-users of Mesa and DRI
|
||||
<li><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-users"
|
||||
target="_parent">mesa-users</a> - intended for end-users of Mesa and DRI
|
||||
drivers. Newbie questions are OK, but please try the general OpenGL
|
||||
resources and Mesa/DRI documentation first.
|
||||
</li>
|
||||
<br>
|
||||
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-dev"
|
||||
target="_parent">mesa3d-dev</a> - for Mesa, Gallium and DRI development
|
||||
<li><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev"
|
||||
target="_parent">mesa-dev</a> - for Mesa, Gallium and DRI development
|
||||
discussion. Not for beginners.
|
||||
</li>
|
||||
<br>
|
||||
@@ -30,8 +30,8 @@ target="_parent">mesa-commit</a> - relays git check-in messages
|
||||
In general, people should not post to this list.
|
||||
</li>
|
||||
<br>
|
||||
<li><a href="https://lists.sourceforge.net/lists/listinfo/mesa3d-announce"
|
||||
target="_parent">mesa3d-announce</a> - announcements of new Mesa
|
||||
<li><a href="http://lists.freedesktop.org/mailman/listinfo/mesa-announce"
|
||||
target="_parent">mesa-announce</a> - announcements of new Mesa
|
||||
versions are sent to this list. Very low traffic.
|
||||
</li>
|
||||
</ul>
|
||||
|
46
docs/relnotes-7.8.2.html
Normal file
46
docs/relnotes-7.8.2.html
Normal file
@@ -0,0 +1,46 @@
|
||||
<HTML>
|
||||
|
||||
<TITLE>Mesa Release Notes</TITLE>
|
||||
|
||||
<head><link rel="stylesheet" type="text/css" href="mesa.css"></head>
|
||||
|
||||
<BODY>
|
||||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 7.8.2 Release Notes / April, 5, 2010</H1>
|
||||
|
||||
<p>
|
||||
Mesa 7.8.2 is a bug fix release which fixes bugs found since the 7.8.1 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 7.8.2 implements the OpenGL 2.1 API, but the version reported by
|
||||
glGetString(GL_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 2.1.
|
||||
</p>
|
||||
<p>
|
||||
See the <a href="install.html">Compiling/Installing page</a> for prerequisites
|
||||
for DRI hardware acceleration.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<pre>
|
||||
tbd
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
<p>None.</p>
|
||||
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
<ul>
|
||||
<li>Fixed Gallium glDrawPixels(GL_DEPTH_COMPONENT).
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
<p>None.</p>
|
||||
</body>
|
||||
</html>
|
@@ -13,6 +13,7 @@ The release notes summarize what's new or changed in each Mesa release.
|
||||
</p>
|
||||
|
||||
<UL>
|
||||
<LI><A HREF="relnotes-7.8.2.html">7.8.2 release notes</A>
|
||||
<LI><A HREF="relnotes-7.8.1.html">7.8.1 release notes</A>
|
||||
<LI><A HREF="relnotes-7.8.html">7.8 release notes</A>
|
||||
<LI><A HREF="relnotes-7.7.1.html">7.7.1 release notes</A>
|
||||
|
@@ -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)
|
||||
|
@@ -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 *~
|
||||
|
@@ -102,6 +102,19 @@ static void Display(void)
|
||||
|
||||
/* read back scaled depth image */
|
||||
glReadPixels(100, 0, 400, 400, GL_DEPTH_COMPONENT, GL_FLOAT, depth2);
|
||||
|
||||
/* debug */
|
||||
if (0) {
|
||||
int i;
|
||||
float *z = depth2 + 400 * 200;
|
||||
printf("z at y=200:\n");
|
||||
for (i = 0; i < 400; i++) {
|
||||
printf("%5.3f ", z[i]);
|
||||
if ((i + 1) % 12 == 0)
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* draw as luminance */
|
||||
glPixelZoom(1.0, 1.0);
|
||||
glWindowPos2i(100, 0);
|
||||
|
@@ -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 \
|
||||
|
@@ -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
|
||||
|
@@ -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 \
|
||||
|
@@ -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];
|
||||
}
|
||||
|
@@ -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 );
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -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 */
|
||||
|
@@ -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));
|
||||
|
@@ -243,7 +243,7 @@ uint i915_emit_texld( struct i915_fp_compile *p,
|
||||
}
|
||||
else {
|
||||
assert(GET_UREG_TYPE(dest) != REG_TYPE_CONST);
|
||||
assert(dest = UREG(GET_UREG_TYPE(dest), GET_UREG_NR(dest)));
|
||||
assert(dest == UREG(GET_UREG_TYPE(dest), GET_UREG_NR(dest)));
|
||||
|
||||
/* is the sampler coord a texcoord input reg? */
|
||||
if (GET_UREG_TYPE(coord) != REG_TYPE_T) {
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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)
|
||||
{
|
||||
|
@@ -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));
|
||||
|
||||
|
@@ -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. */
|
||||
|
@@ -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) {
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -669,17 +669,17 @@ static void setup_tri_edges( struct setup_context *setup )
|
||||
|
||||
setup->emaj.sy = ceilf(vmin_y);
|
||||
setup->emaj.lines = (int) ceilf(vmax_y - setup->emaj.sy);
|
||||
setup->emaj.dxdy = setup->emaj.dx / setup->emaj.dy;
|
||||
setup->emaj.dxdy = setup->emaj.dy ? setup->emaj.dx / setup->emaj.dy : .0f;
|
||||
setup->emaj.sx = vmin_x + (setup->emaj.sy - vmin_y) * setup->emaj.dxdy;
|
||||
|
||||
setup->etop.sy = ceilf(vmid_y);
|
||||
setup->etop.lines = (int) ceilf(vmax_y - setup->etop.sy);
|
||||
setup->etop.dxdy = setup->etop.dx / setup->etop.dy;
|
||||
setup->etop.dxdy = setup->etop.dy ? setup->etop.dx / setup->etop.dy : .0f;
|
||||
setup->etop.sx = vmid_x + (setup->etop.sy - vmid_y) * setup->etop.dxdy;
|
||||
|
||||
setup->ebot.sy = ceilf(vmin_y);
|
||||
setup->ebot.lines = (int) ceilf(vmid_y - setup->ebot.sy);
|
||||
setup->ebot.dxdy = setup->ebot.dx / setup->ebot.dy;
|
||||
setup->ebot.dxdy = setup->ebot.dy ? setup->ebot.dx / setup->ebot.dy : .0f;
|
||||
setup->ebot.sx = vmin_x + (setup->ebot.sy - vmin_y) * setup->ebot.dxdy;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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,
|
||||
|
@@ -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) \
|
||||
|
@@ -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 \
|
||||
|
@@ -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
|
||||
|
@@ -101,8 +101,7 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire)
|
||||
GLXBufferSwapComplete *aevent = (GLXBufferSwapComplete *)event;
|
||||
xDRI2BufferSwapComplete *awire = (xDRI2BufferSwapComplete *)wire;
|
||||
aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire);
|
||||
aevent->type =
|
||||
(glx_info->codes->first_event + GLX_BufferSwapComplete) & 0x75;
|
||||
aevent->type = glx_info->codes->first_event + GLX_BufferSwapComplete;
|
||||
aevent->send_event = (awire->type & 0x80) != 0;
|
||||
aevent->display = dpy;
|
||||
aevent->drawable = awire->drawable;
|
||||
|
@@ -175,6 +175,8 @@ dri2CreateDrawable(__GLXscreenConfigs * psc,
|
||||
{
|
||||
__GLXDRIdrawablePrivate *pdraw;
|
||||
__GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) modes;
|
||||
__GLXdisplayPrivate *dpyPriv;
|
||||
__GLXDRIdisplayPrivate *pdp;
|
||||
|
||||
pdraw = Xmalloc(sizeof(*pdraw));
|
||||
if (!pdraw)
|
||||
@@ -185,9 +187,12 @@ dri2CreateDrawable(__GLXscreenConfigs * psc,
|
||||
pdraw->base.drawable = drawable;
|
||||
pdraw->base.psc = psc;
|
||||
pdraw->bufferCount = 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,
|
||||
@@ -199,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;
|
||||
}
|
||||
|
||||
|
@@ -1110,6 +1110,13 @@ init_fbconfig_for_chooser(__GLcontextModes * config,
|
||||
} \
|
||||
} while ( 0 )
|
||||
|
||||
/* Test that all bits from a are contained in b */
|
||||
#define MATCH_MASK(param) \
|
||||
do { \
|
||||
if ((a->param & ~b->param) != 0) \
|
||||
return False; \
|
||||
} while (0);
|
||||
|
||||
/**
|
||||
* Determine if two GLXFBConfigs are compatible.
|
||||
*
|
||||
@@ -1148,11 +1155,8 @@ fbconfigs_compatible(const __GLcontextModes * const a,
|
||||
MATCH_DONT_CARE(stereoMode);
|
||||
MATCH_EXACT(level);
|
||||
|
||||
if (((a->drawableType & b->drawableType) == 0)
|
||||
|| ((a->renderType & b->renderType) == 0)) {
|
||||
return False;
|
||||
}
|
||||
|
||||
MATCH_MASK(drawableType);
|
||||
MATCH_MASK(renderType);
|
||||
|
||||
/* There is a bug in a few of the XFree86 DDX drivers. They contain
|
||||
* visuals with a "transparent type" of 0 when they really mean GLX_NONE.
|
||||
|
@@ -539,6 +539,8 @@ __glXInitializeVisualConfigFromTags(__GLcontextModes * config, int count,
|
||||
i = count;
|
||||
break;
|
||||
default:
|
||||
/* Ignore the unrecognized tag's value */
|
||||
bp++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@@ -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. */
|
||||
|
@@ -247,8 +247,6 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask)
|
||||
GLuint buf;
|
||||
all = (cw == fb->Width && ch == fb->Height);
|
||||
|
||||
intel_prepare_render(intel);
|
||||
|
||||
/* Loop over all renderbuffers */
|
||||
for (buf = 0; buf < BUFFER_COUNT && mask; buf++) {
|
||||
const GLbitfield bufBit = 1 << buf;
|
||||
|
@@ -90,6 +90,10 @@ intelClear(GLcontext *ctx, GLbitfield mask)
|
||||
tri_mask |= (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT));
|
||||
}
|
||||
|
||||
/* Make sure we have up to date buffers before we start looking at
|
||||
* the tiling bits to determine how to clear. */
|
||||
intel_prepare_render(intel);
|
||||
|
||||
/* HW stencil */
|
||||
if (mask & BUFFER_BIT_STENCIL) {
|
||||
const struct intel_region *stencilRegion
|
||||
|
@@ -61,6 +61,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include "r300_state.h"
|
||||
#include "r300_tex.h"
|
||||
#include "r300_emit.h"
|
||||
#include "r300_render.h"
|
||||
#include "r300_swtcl.h"
|
||||
#include "radeon_bocs_wrapper.h"
|
||||
#include "radeon_buffer_objects.h"
|
||||
@@ -226,6 +227,8 @@ static void r300_fallback(GLcontext *ctx, GLuint bit, GLboolean mode)
|
||||
r300->radeon.Fallback |= bit;
|
||||
else
|
||||
r300->radeon.Fallback &= ~bit;
|
||||
|
||||
r300SwitchFallback(ctx, R300_FALLBACK_RADEON_COMMON, mode);
|
||||
}
|
||||
|
||||
static void r300_emit_query_finish(radeonContextPtr radeon)
|
||||
|
@@ -386,6 +386,14 @@ void r300RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim)
|
||||
WARN_ONCE("Fixme: can't handle spliting prim %d\n", prim);
|
||||
return;
|
||||
}
|
||||
|
||||
if (rmesa->radeon.radeonScreen->kernel_mm) {
|
||||
BEGIN_BATCH_NO_AUTOSTATE(2);
|
||||
OUT_BATCH_REGSEQ(R300_VAP_VF_MAX_VTX_INDX, 1);
|
||||
OUT_BATCH(rmesa->radeon.tcl.aos[0].count);
|
||||
END_BATCH();
|
||||
}
|
||||
|
||||
r300_emit_scissor(rmesa->radeon.glCtx);
|
||||
while (num_verts > 0) {
|
||||
int nr;
|
||||
@@ -400,8 +408,9 @@ void r300RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim)
|
||||
COMMIT_BATCH();
|
||||
}
|
||||
|
||||
static const char *getFallbackString(uint32_t bit)
|
||||
static const char *getFallbackString(r300ContextPtr rmesa, uint32_t bit)
|
||||
{
|
||||
static char common_fallback_str[32];
|
||||
switch (bit) {
|
||||
case R300_FALLBACK_VERTEX_PROGRAM :
|
||||
return "vertex program";
|
||||
@@ -421,6 +430,9 @@ static const char *getFallbackString(uint32_t bit)
|
||||
return "render mode != GL_RENDER";
|
||||
case R300_FALLBACK_FRAGMENT_PROGRAM:
|
||||
return "fragment program";
|
||||
case R300_FALLBACK_RADEON_COMMON:
|
||||
snprintf(common_fallback_str, 32, "radeon common 0x%08x", rmesa->radeon.Fallback);
|
||||
return common_fallback_str;
|
||||
case R300_FALLBACK_AOS_LIMIT:
|
||||
return "aos limit";
|
||||
case R300_FALLBACK_INVALID_BUFFERS:
|
||||
@@ -440,7 +452,7 @@ void r300SwitchFallback(GLcontext *ctx, uint32_t bit, GLboolean mode)
|
||||
if (mode) {
|
||||
if ((fallback_warn & bit) == 0) {
|
||||
if (RADEON_DEBUG & RADEON_FALLBACKS)
|
||||
fprintf(stderr, "WARNING! Falling back to software for %s\n", getFallbackString(bit));
|
||||
fprintf(stderr, "WARNING! Falling back to software for %s\n", getFallbackString(rmesa, bit));
|
||||
fallback_warn |= bit;
|
||||
}
|
||||
rmesa->fallback |= bit;
|
||||
|
@@ -41,6 +41,7 @@
|
||||
#define R300_FALLBACK_STENCIL_TWOSIDE (1 << 21)
|
||||
#define R300_FALLBACK_RENDER_MODE (1 << 22)
|
||||
#define R300_FALLBACK_FRAGMENT_PROGRAM (1 << 23)
|
||||
#define R300_FALLBACK_RADEON_COMMON (1 << 29)
|
||||
#define R300_FALLBACK_AOS_LIMIT (1 << 30)
|
||||
#define R300_FALLBACK_INVALID_BUFFERS (1 << 31)
|
||||
#define R300_RASTER_FALLBACK_MASK 0xffff0000
|
||||
|
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
|
@@ -357,6 +357,7 @@
|
||||
#define PCI_CHIP_RV770_9456 0x9456
|
||||
#define PCI_CHIP_RV770_945A 0x945A
|
||||
#define PCI_CHIP_RV770_945B 0x945B
|
||||
#define PCI_CHIP_RV770_945E 0x945E
|
||||
#define PCI_CHIP_RV790_9460 0x9460
|
||||
#define PCI_CHIP_RV790_9462 0x9462
|
||||
#define PCI_CHIP_RV770_946A 0x946A
|
||||
@@ -368,6 +369,7 @@
|
||||
#define PCI_CHIP_RV730_9487 0x9487
|
||||
#define PCI_CHIP_RV730_9488 0x9488
|
||||
#define PCI_CHIP_RV730_9489 0x9489
|
||||
#define PCI_CHIP_RV730_948A 0x948A
|
||||
#define PCI_CHIP_RV730_948F 0x948F
|
||||
#define PCI_CHIP_RV730_9490 0x9490
|
||||
#define PCI_CHIP_RV730_9491 0x9491
|
||||
@@ -386,6 +388,7 @@
|
||||
#define PCI_CHIP_RV710_9553 0x9553
|
||||
#define PCI_CHIP_RV710_9555 0x9555
|
||||
#define PCI_CHIP_RV710_9557 0x9557
|
||||
#define PCI_CHIP_RV710_955F 0x955F
|
||||
|
||||
#define PCI_CHIP_RV740_94A0 0x94A0
|
||||
#define PCI_CHIP_RV740_94A1 0x94A1
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -846,6 +846,7 @@ static int radeon_set_screen_flags(radeonScreenPtr screen, int device_id)
|
||||
case PCI_CHIP_RV770_9456:
|
||||
case PCI_CHIP_RV770_945A:
|
||||
case PCI_CHIP_RV770_945B:
|
||||
case PCI_CHIP_RV770_945E:
|
||||
case PCI_CHIP_RV790_9460:
|
||||
case PCI_CHIP_RV790_9462:
|
||||
case PCI_CHIP_RV770_946A:
|
||||
@@ -860,6 +861,7 @@ static int radeon_set_screen_flags(radeonScreenPtr screen, int device_id)
|
||||
case PCI_CHIP_RV730_9487:
|
||||
case PCI_CHIP_RV730_9488:
|
||||
case PCI_CHIP_RV730_9489:
|
||||
case PCI_CHIP_RV730_948A:
|
||||
case PCI_CHIP_RV730_948F:
|
||||
case PCI_CHIP_RV730_9490:
|
||||
case PCI_CHIP_RV730_9491:
|
||||
@@ -881,6 +883,7 @@ static int radeon_set_screen_flags(radeonScreenPtr screen, int device_id)
|
||||
case PCI_CHIP_RV710_9553:
|
||||
case PCI_CHIP_RV710_9555:
|
||||
case PCI_CHIP_RV710_9557:
|
||||
case PCI_CHIP_RV710_955F:
|
||||
screen->chip_family = CHIP_FAMILY_RV710;
|
||||
screen->chip_flags = RADEON_CHIPSET_TCL;
|
||||
break;
|
||||
@@ -1133,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;
|
||||
@@ -1340,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;
|
||||
|
@@ -44,6 +44,7 @@
|
||||
#include "tnl/t_pipeline.h"
|
||||
|
||||
#include "drivers/common/driverfuncs.h"
|
||||
#include "drivers/common/meta.h"
|
||||
|
||||
#include "savagedd.h"
|
||||
#include "savagestate.h"
|
||||
@@ -473,6 +474,8 @@ savageCreateContext( const __GLcontextModes *mesaVis,
|
||||
imesa->CurrentTexObj[0] = 0;
|
||||
imesa->CurrentTexObj[1] = 0;
|
||||
|
||||
_mesa_meta_init( ctx );
|
||||
|
||||
/* Initialize the software rasterizer and helper modules.
|
||||
*/
|
||||
_swrast_CreateContext( ctx );
|
||||
@@ -564,6 +567,8 @@ savageDestroyContext(__DRIcontext *driContextPriv)
|
||||
free(imesa->cmdBuf.base);
|
||||
free(imesa->clientVtxBuf.buf);
|
||||
|
||||
_mesa_meta_free( imesa->glCtx );
|
||||
|
||||
_swsetup_DestroyContext(imesa->glCtx );
|
||||
_tnl_DestroyContext( imesa->glCtx );
|
||||
_vbo_DestroyContext( imesa->glCtx );
|
||||
|
@@ -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;
|
||||
|
@@ -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));
|
||||
|
@@ -1415,6 +1415,7 @@ create_new_program(GLcontext *ctx, struct state_key *key,
|
||||
struct texenv_fragment_program p;
|
||||
GLuint unit;
|
||||
struct ureg cf, out;
|
||||
int i;
|
||||
|
||||
memset(&p, 0, sizeof(p));
|
||||
p.state = key;
|
||||
@@ -1436,7 +1437,13 @@ create_new_program(GLcontext *ctx, struct state_key *key,
|
||||
p.program->Base.NumAddressRegs = 0;
|
||||
p.program->Base.Parameters = _mesa_new_parameter_list();
|
||||
p.program->Base.InputsRead = 0x0;
|
||||
p.program->Base.OutputsWritten = 1 << FRAG_RESULT_COLOR;
|
||||
|
||||
if (ctx->DrawBuffer->_NumColorDrawBuffers == 1)
|
||||
p.program->Base.OutputsWritten = 1 << FRAG_RESULT_COLOR;
|
||||
else {
|
||||
for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++)
|
||||
p.program->Base.OutputsWritten |= (1 << (FRAG_RESULT_DATA0 + i));
|
||||
}
|
||||
|
||||
for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
|
||||
p.src_texture[unit] = undef;
|
||||
@@ -1485,22 +1492,28 @@ create_new_program(GLcontext *ctx, struct state_key *key,
|
||||
}
|
||||
|
||||
cf = get_source( &p, SRC_PREVIOUS, 0 );
|
||||
out = make_ureg( PROGRAM_OUTPUT, FRAG_RESULT_COLOR );
|
||||
|
||||
if (key->separate_specular) {
|
||||
/* Emit specular add.
|
||||
*/
|
||||
struct ureg s = register_input(&p, FRAG_ATTRIB_COL1);
|
||||
emit_arith( &p, OPCODE_ADD, out, WRITEMASK_XYZ, 0, cf, s, undef );
|
||||
emit_arith( &p, OPCODE_MOV, out, WRITEMASK_W, 0, cf, undef, undef );
|
||||
}
|
||||
else if (memcmp(&cf, &out, sizeof(cf)) != 0) {
|
||||
/* Will wind up in here if no texture enabled or a couple of
|
||||
* other scenarios (GL_REPLACE for instance).
|
||||
*/
|
||||
emit_arith( &p, OPCODE_MOV, out, WRITEMASK_XYZW, 0, cf, undef, undef );
|
||||
}
|
||||
for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) {
|
||||
if (ctx->DrawBuffer->_NumColorDrawBuffers == 1)
|
||||
out = make_ureg( PROGRAM_OUTPUT, FRAG_RESULT_COLOR );
|
||||
else {
|
||||
out = make_ureg( PROGRAM_OUTPUT, FRAG_RESULT_DATA0 + i );
|
||||
}
|
||||
|
||||
if (key->separate_specular) {
|
||||
/* Emit specular add.
|
||||
*/
|
||||
struct ureg s = register_input(&p, FRAG_ATTRIB_COL1);
|
||||
emit_arith( &p, OPCODE_ADD, out, WRITEMASK_XYZ, 0, cf, s, undef );
|
||||
emit_arith( &p, OPCODE_MOV, out, WRITEMASK_W, 0, cf, undef, undef );
|
||||
}
|
||||
else if (memcmp(&cf, &out, sizeof(cf)) != 0) {
|
||||
/* Will wind up in here if no texture enabled or a couple of
|
||||
* other scenarios (GL_REPLACE for instance).
|
||||
*/
|
||||
emit_arith( &p, OPCODE_MOV, out, WRITEMASK_XYZW, 0, cf, undef, undef );
|
||||
}
|
||||
}
|
||||
/* Finish up:
|
||||
*/
|
||||
emit_arith( &p, OPCODE_END, undef, WRITEMASK_XYZW, 0, undef, undef, undef);
|
||||
|
@@ -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
|
||||
|
@@ -625,7 +625,7 @@ replace_registers(struct prog_instruction *inst, GLuint numInst,
|
||||
GLuint i, j;
|
||||
for (i = 0; i < numInst; i++) {
|
||||
/* src regs */
|
||||
for (j = 0; j < _mesa_num_inst_src_regs(inst->Opcode); j++) {
|
||||
for (j = 0; j < _mesa_num_inst_src_regs(inst[i].Opcode); j++) {
|
||||
if (inst[i].SrcReg[j].File == oldFile &&
|
||||
inst[i].SrcReg[j].Index == oldIndex) {
|
||||
inst[i].SrcReg[j].File = newFile;
|
||||
@@ -652,7 +652,7 @@ adjust_param_indexes(struct prog_instruction *inst, GLuint numInst,
|
||||
{
|
||||
GLuint i, j;
|
||||
for (i = 0; i < numInst; i++) {
|
||||
for (j = 0; j < _mesa_num_inst_src_regs(inst->Opcode); j++) {
|
||||
for (j = 0; j < _mesa_num_inst_src_regs(inst[i].Opcode); j++) {
|
||||
GLuint f = inst[i].SrcReg[j].File;
|
||||
if (f == PROGRAM_CONSTANT ||
|
||||
f == PROGRAM_UNIFORM ||
|
||||
|
@@ -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 */
|
||||
|
@@ -250,13 +250,13 @@ make_passthrough_vertex_shader(struct st_context *st,
|
||||
ureg_DECL_output( ureg, TGSI_SEMANTIC_POSITION, 0 ),
|
||||
ureg_DECL_vs_input( ureg, 0 ));
|
||||
|
||||
/* MOV result.texcoord0, vertex.texcoord0; */
|
||||
/* MOV result.texcoord0, vertex.attr[1]; */
|
||||
ureg_MOV(ureg,
|
||||
ureg_DECL_output( ureg, TGSI_SEMANTIC_GENERIC, 0 ),
|
||||
ureg_DECL_vs_input( ureg, 1 ));
|
||||
|
||||
if (passColor) {
|
||||
/* MOV result.color0, vertex.color0; */
|
||||
/* MOV result.color0, vertex.attr[2]; */
|
||||
ureg_MOV(ureg,
|
||||
ureg_DECL_output( ureg, TGSI_SEMANTIC_COLOR, 0 ),
|
||||
ureg_DECL_vs_input( ureg, 2 ));
|
||||
@@ -430,7 +430,7 @@ draw_quad(GLcontext *ctx, GLfloat x0, GLfloat y0, GLfloat z,
|
||||
const GLfloat sLeft = 0.0f, sRight = maxXcoord;
|
||||
const GLfloat tTop = invertTex ? maxYcoord : 0.0f;
|
||||
const GLfloat tBot = invertTex ? 0.0f : maxYcoord;
|
||||
GLuint tex, i;
|
||||
GLuint i;
|
||||
|
||||
/* upper-left */
|
||||
verts[0][0][0] = clip_x0; /* v[0].attr[0].x */
|
||||
@@ -448,32 +448,31 @@ draw_quad(GLcontext *ctx, GLfloat x0, GLfloat y0, GLfloat z,
|
||||
verts[3][0][0] = clip_x0;
|
||||
verts[3][0][1] = clip_y1;
|
||||
|
||||
tex = color ? 2 : 1;
|
||||
verts[0][tex][0] = sLeft; /* v[0].attr[tex].s */
|
||||
verts[0][tex][1] = tTop; /* v[0].attr[tex].t */
|
||||
verts[1][tex][0] = sRight;
|
||||
verts[1][tex][1] = tTop;
|
||||
verts[2][tex][0] = sRight;
|
||||
verts[2][tex][1] = tBot;
|
||||
verts[3][tex][0] = sLeft;
|
||||
verts[3][tex][1] = tBot;
|
||||
verts[0][1][0] = sLeft; /* v[0].attr[1].S */
|
||||
verts[0][1][1] = tTop; /* v[0].attr[1].T */
|
||||
verts[1][1][0] = sRight;
|
||||
verts[1][1][1] = tTop;
|
||||
verts[2][1][0] = sRight;
|
||||
verts[2][1][1] = tBot;
|
||||
verts[3][1][0] = sLeft;
|
||||
verts[3][1][1] = tBot;
|
||||
|
||||
/* same for all verts: */
|
||||
if (color) {
|
||||
for (i = 0; i < 4; i++) {
|
||||
verts[i][0][2] = z; /*Z*/
|
||||
verts[i][0][3] = 1.0f; /*W*/
|
||||
verts[i][1][0] = color[0];
|
||||
verts[i][1][1] = color[1];
|
||||
verts[i][1][2] = color[2];
|
||||
verts[i][1][3] = color[3];
|
||||
verts[i][2][2] = 0.0f; /*R*/
|
||||
verts[i][2][3] = 1.0f; /*Q*/
|
||||
verts[i][0][2] = z; /* v[i].attr[0].z */
|
||||
verts[i][0][3] = 1.0f; /* v[i].attr[0].w */
|
||||
verts[i][2][0] = color[0]; /* v[i].attr[2].r */
|
||||
verts[i][2][1] = color[1]; /* v[i].attr[2].g */
|
||||
verts[i][2][2] = color[2]; /* v[i].attr[2].b */
|
||||
verts[i][2][3] = color[3]; /* v[i].attr[2].a */
|
||||
verts[i][1][2] = 0.0f; /* v[i].attr[1].R */
|
||||
verts[i][1][3] = 1.0f; /* v[i].attr[1].Q */
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < 4; i++) {
|
||||
verts[i][0][2] = z; /*Z*/
|
||||
verts[i][0][2] = z; /*Z*/
|
||||
verts[i][0][3] = 1.0f; /*W*/
|
||||
verts[i][1][2] = 0.0f; /*R*/
|
||||
verts[i][1][3] = 1.0f; /*Q*/
|
||||
|
@@ -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.
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user