Merge branch 'mesa_7_7_branch'
Conflicts: configs/darwin src/gallium/auxiliary/util/u_clear.h src/gallium/state_trackers/xorg/xorg_exa_tgsi.c src/mesa/drivers/dri/i965/brw_draw_upload.c
This commit is contained in:
commit
25024d9482
|
@ -49,7 +49,7 @@ GLW_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X
|
|||
APP_LIB_DEPS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) -L$(INSTALL_DIR)/$(LIB_DIR) -L$(X11_DIR)/$(LIB_DIR) -lX11 -lXmu -lXt -lXi -lm
|
||||
|
||||
# omit glw lib for now:
|
||||
SRC_DIRS = glsl glx/x11 mesa glu glut/glx glew
|
||||
SRC_DIRS = glsl glx/x11 mesa gallium glu glut/glx glew
|
||||
GLU_DIRS = sgi
|
||||
DRIVER_DIRS = osmesa
|
||||
#DRIVER_DIRS = dri
|
||||
|
|
|
@ -10,11 +10,15 @@
|
|||
|
||||
<H1>News</H1>
|
||||
|
||||
<h2>November XX, 2009</h2>
|
||||
<h2>December 21, 2009</h2>
|
||||
<p>
|
||||
<a href="relnotes-7.6.1.html">Mesa 7.6.1</a> is released. This is a bug-fix
|
||||
release fixing issues found in the 7.6 release.
|
||||
</p>
|
||||
<p>
|
||||
Also, <a href="relnotes-7.7.html">Mesa 7.7</a> is released. This is a new
|
||||
development release.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>September 28, 2009</h2>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 7.6.1 Release Notes, (date tbd)</H1>
|
||||
<H1>Mesa 7.6.1 Release Notes, 21 December 2009</H1>
|
||||
|
||||
<p>
|
||||
Mesa 7.6.1 is a bug-fix release fixing issues since version 7.6.
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
<body bgcolor="#eeeeee">
|
||||
|
||||
<H1>Mesa 7.7 Release Notes / date TBD</H1>
|
||||
<H1>Mesa 7.7 Release Notes / 21 December 2009</H1>
|
||||
|
||||
<p>
|
||||
Mesa 7.7 is a new development release.
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include <assert.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <GL/glut.h>
|
||||
|
@ -129,8 +130,10 @@ Clear_Buffers ()
|
|||
static void
|
||||
LoadTriplet (TDA A)
|
||||
{
|
||||
int result;
|
||||
Clear_Buffers ();
|
||||
fscanf (mainfile, "%s %s %s %s", Buf1, Buf2, Buf3, Buf4);
|
||||
result = fscanf (mainfile, "%s %s %s %s", Buf1, Buf2, Buf3, Buf4);
|
||||
assert(result != EOF);
|
||||
A[0] = atof (Buf2);
|
||||
A[1] = atof (Buf3);
|
||||
A[2] = atof (Buf4);
|
||||
|
@ -140,8 +143,10 @@ LoadTriplet (TDA A)
|
|||
static void
|
||||
LoadReal (float *a)
|
||||
{
|
||||
int result;
|
||||
Clear_Buffers ();
|
||||
fscanf (mainfile, "%s %s", Buf1, Buf2);
|
||||
result = fscanf (mainfile, "%s %s", Buf1, Buf2);
|
||||
assert(result != EOF);
|
||||
*a = atof (Buf2);
|
||||
}
|
||||
|
||||
|
@ -149,8 +154,10 @@ LoadReal (float *a)
|
|||
static void
|
||||
LoadInteger (int *a)
|
||||
{
|
||||
int result;
|
||||
Clear_Buffers ();
|
||||
fscanf (mainfile, "%s %s", Buf1, Buf2);
|
||||
result = fscanf (mainfile, "%s %s", Buf1, Buf2);
|
||||
assert(result != EOF);
|
||||
*a = atoi (Buf2);
|
||||
}
|
||||
|
||||
|
@ -158,8 +165,10 @@ LoadInteger (int *a)
|
|||
static void
|
||||
LoadText (char *a)
|
||||
{
|
||||
int result;
|
||||
Clear_Buffers ();
|
||||
fscanf (mainfile, "%s %s", Buf1, Buf2);
|
||||
result = fscanf (mainfile, "%s %s", Buf1, Buf2);
|
||||
assert(result != EOF);
|
||||
strcpy (a, Buf2);
|
||||
}
|
||||
|
||||
|
@ -177,8 +186,10 @@ getdata (char filename[])
|
|||
|
||||
do
|
||||
{
|
||||
int result;
|
||||
Clear_Buffers ();
|
||||
fscanf (mainfile, "%s", Buf1);
|
||||
result = fscanf (mainfile, "%s", Buf1);
|
||||
(void) result;
|
||||
if (ferror (mainfile))
|
||||
{
|
||||
printf ("\nError opening file !\n");
|
||||
|
|
|
@ -132,9 +132,11 @@ static void read_surface( char *filename )
|
|||
|
||||
numverts = 0;
|
||||
while (!feof(f) && numverts<maxverts) {
|
||||
fscanf( f, "%f %f %f %f %f %f",
|
||||
&data[numverts][0], &data[numverts][1], &data[numverts][2],
|
||||
&data[numverts][3], &data[numverts][4], &data[numverts][5] );
|
||||
int result;
|
||||
result = fscanf( f, "%f %f %f %f %f %f",
|
||||
&data[numverts][0], &data[numverts][1], &data[numverts][2],
|
||||
&data[numverts][3], &data[numverts][4], &data[numverts][5] );
|
||||
(void) result;
|
||||
numverts++;
|
||||
}
|
||||
numverts--;
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
* based on a Mikael SkiZoWalker's (MoDEL) / France (Skizo@Hol.Fr) demo
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -559,12 +560,14 @@ loadpic(void)
|
|||
FILE *FilePic;
|
||||
int i, tmp;
|
||||
GLenum gluerr;
|
||||
size_t result;
|
||||
|
||||
if ((FilePic = fopen("terrain.dat", "r")) == NULL) {
|
||||
fprintf(stderr, "Error loading terrain.dat\n");
|
||||
exit(-1);
|
||||
}
|
||||
fread(bufferter, 256 * 256, 1, FilePic);
|
||||
result = fread(bufferter, 256 * 256, 1, FilePic);
|
||||
assert(result == 1);
|
||||
fclose(FilePic);
|
||||
|
||||
for (i = 0; i < (256 * 256); i++) {
|
||||
|
|
|
@ -492,9 +492,8 @@ ReadConfigFile(const char *filename, struct config_file *conf)
|
|||
conf->num_uniforms = 0;
|
||||
|
||||
/* ugly but functional parser */
|
||||
while (!feof(f)) {
|
||||
fgets(line, sizeof(line), f);
|
||||
if (!feof(f) && line[0]) {
|
||||
while (fgets(line, sizeof(line), f) != NULL) {
|
||||
if (line[0]) {
|
||||
if (strncmp(line, "vs ", 3) == 0) {
|
||||
VertShaderFile = strdup(line + 3);
|
||||
VertShaderFile[strlen(VertShaderFile) - 1] = 0;
|
||||
|
|
|
@ -40,15 +40,6 @@ static GLboolean Anim = GL_TRUE;
|
|||
static GLboolean WireFrame = GL_TRUE;
|
||||
static GLfloat xRot = -70.0f, yRot = 0.0f, zRot = 0.0f;
|
||||
|
||||
|
||||
/* value[0] = tex unit */
|
||||
static struct uniform_info Uniforms[] = {
|
||||
{ "tex1", 1, GL_SAMPLER_2D, { 0, 0, 0, 0 }, -1 },
|
||||
END_OF_UNIFORMS
|
||||
};
|
||||
|
||||
|
||||
|
||||
static void
|
||||
Idle(void)
|
||||
{
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -89,6 +90,7 @@ static rawImageRec *RawImageOpen(const char *fileName)
|
|||
rawImageRec *raw;
|
||||
GLenum swapFlag;
|
||||
int x;
|
||||
size_t result;
|
||||
|
||||
endianTest.testWord = 1;
|
||||
if (endianTest.testByte[0] == 1) {
|
||||
|
@ -114,7 +116,8 @@ static rawImageRec *RawImageOpen(const char *fileName)
|
|||
}
|
||||
}
|
||||
|
||||
fread(raw, 1, 12, raw->file);
|
||||
result = fread(raw, 1, 12, raw->file);
|
||||
assert(result == 12);
|
||||
|
||||
if (swapFlag) {
|
||||
ConvertShort(&raw->imagic, 1);
|
||||
|
@ -162,8 +165,10 @@ static rawImageRec *RawImageOpen(const char *fileName)
|
|||
}
|
||||
raw->rleEnd = 512 + (2 * x);
|
||||
fseek(raw->file, 512, SEEK_SET);
|
||||
fread(raw->rowStart, 1, x, raw->file);
|
||||
fread(raw->rowSize, 1, x, raw->file);
|
||||
result = fread(raw->rowStart, 1, x, raw->file);
|
||||
assert(result == x);
|
||||
result = fread(raw->rowSize, 1, x, raw->file);
|
||||
assert(result == x);
|
||||
if (swapFlag) {
|
||||
ConvertLong(raw->rowStart, (long) (x/sizeof(GLuint)));
|
||||
ConvertLong((GLuint *)raw->rowSize, (long) (x/sizeof(GLint)));
|
||||
|
@ -193,11 +198,13 @@ static void RawImageGetRow(rawImageRec *raw, unsigned char *buf, int y, int z)
|
|||
{
|
||||
unsigned char *iPtr, *oPtr, pixel;
|
||||
int count, done = 0;
|
||||
size_t result;
|
||||
|
||||
if ((raw->type & 0xFF00) == 0x0100) {
|
||||
fseek(raw->file, (long) raw->rowStart[y+z*raw->sizeY], SEEK_SET);
|
||||
fread(raw->tmp, 1, (unsigned int)raw->rowSize[y+z*raw->sizeY],
|
||||
raw->file);
|
||||
result = fread(raw->tmp, 1, (unsigned int)raw->rowSize[y+z*raw->sizeY],
|
||||
raw->file);
|
||||
assert(result == (unsigned int)raw->rowSize[y+z*raw->sizeY]);
|
||||
|
||||
iPtr = raw->tmp;
|
||||
oPtr = buf;
|
||||
|
@ -222,7 +229,8 @@ static void RawImageGetRow(rawImageRec *raw, unsigned char *buf, int y, int z)
|
|||
} else {
|
||||
fseek(raw->file, 512+(y*raw->sizeX)+(z*raw->sizeX*raw->sizeY),
|
||||
SEEK_SET);
|
||||
fread(buf, 1, raw->sizeX, raw->file);
|
||||
result = fread(buf, 1, raw->sizeX, raw->file);
|
||||
assert(result == raw->sizeX);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ typedef enum
|
|||
RBUG_BLOCK_BEFORE = 1,
|
||||
RBUG_BLOCK_AFTER = 2,
|
||||
RBUG_BLOCK_RULE = 4,
|
||||
RBUG_BLOCK_MASK = 7,
|
||||
RBUG_BLOCK_MASK = 7
|
||||
} rbug_block_t;
|
||||
|
||||
struct rbug_proto_context_list
|
||||
|
|
|
@ -65,7 +65,7 @@ enum rbug_opcode
|
|||
RBUG_OP_SHADER_DISABLE = 770,
|
||||
RBUG_OP_SHADER_REPLACE = 771,
|
||||
RBUG_OP_SHADER_LIST_REPLY = -768,
|
||||
RBUG_OP_SHADER_INFO_REPLY = -769,
|
||||
RBUG_OP_SHADER_INFO_REPLY = -769
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -791,8 +791,8 @@ ureg_insn(struct ureg_program *ureg,
|
|||
unsigned i;
|
||||
boolean saturate;
|
||||
boolean predicate;
|
||||
boolean negate;
|
||||
unsigned swizzle[4];
|
||||
boolean negate = FALSE;
|
||||
unsigned swizzle[4] = { 0 };
|
||||
|
||||
saturate = nr_dst ? dst[0].Saturate : FALSE;
|
||||
predicate = nr_dst ? dst[0].Predicate : FALSE;
|
||||
|
@ -838,8 +838,8 @@ ureg_tex_insn(struct ureg_program *ureg,
|
|||
unsigned i;
|
||||
boolean saturate;
|
||||
boolean predicate;
|
||||
boolean negate;
|
||||
unsigned swizzle[4];
|
||||
boolean negate = FALSE;
|
||||
unsigned swizzle[4] = { 0 };
|
||||
|
||||
saturate = nr_dst ? dst[0].Saturate : FALSE;
|
||||
predicate = nr_dst ? dst[0].Predicate : FALSE;
|
||||
|
|
|
@ -454,7 +454,8 @@ debug_dump_flags(const struct debug_named_value *names,
|
|||
util_strncat(output, "|", sizeof(output));
|
||||
else
|
||||
first = 0;
|
||||
util_strncat(output, names->name, sizeof(output));
|
||||
util_strncat(output, names->name, sizeof(output) - 1);
|
||||
output[sizeof(output) - 1] = '\0';
|
||||
value &= ~names->value;
|
||||
}
|
||||
++names;
|
||||
|
@ -467,7 +468,8 @@ debug_dump_flags(const struct debug_named_value *names,
|
|||
first = 0;
|
||||
|
||||
util_snprintf(rest, sizeof(rest), "0x%08lx", value);
|
||||
util_strncat(output, rest, sizeof(output));
|
||||
util_strncat(output, rest, sizeof(output) - 1);
|
||||
output[sizeof(output) - 1] = '\0';
|
||||
}
|
||||
|
||||
if(first)
|
||||
|
|
|
@ -188,7 +188,7 @@ void _debug_assert_fail(const char *expr,
|
|||
#ifdef DEBUG
|
||||
#define debug_assert(expr) ((expr) ? (void)0 : _debug_assert_fail(#expr, __FILE__, __LINE__, __FUNCTION__))
|
||||
#else
|
||||
#define debug_assert(expr) ((void)0)
|
||||
#define debug_assert(expr) do { } while (0 && (expr))
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
|
||||
# include <winsock2.h>
|
||||
# include <windows.h>
|
||||
#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_BSD)
|
||||
#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_APPLE)
|
||||
# include <sys/socket.h>
|
||||
# include <netinet/in.h>
|
||||
# include <unistd.h>
|
||||
|
@ -54,7 +54,7 @@ u_socket_close(int s)
|
|||
if (s < 0)
|
||||
return;
|
||||
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_BSD)
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_APPLE)
|
||||
shutdown(s, SHUT_RDWR);
|
||||
close(s);
|
||||
#elif defined(PIPE_SUBSYSTEM_WINDOWS_USER)
|
||||
|
@ -169,7 +169,7 @@ u_socket_listen_on_port(uint16_t portnum)
|
|||
void
|
||||
u_socket_block(int s, boolean block)
|
||||
{
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_BSD)
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_APPLE)
|
||||
int old = fcntl(s, F_GETFL, 0);
|
||||
if (old == -1)
|
||||
return;
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
|
||||
# define PIPE_HAVE_SOCKETS
|
||||
#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_BSD)
|
||||
#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_APPLE)
|
||||
# define PIPE_HAVE_SOCKETS
|
||||
#endif
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
#include "pipe/p_config.h"
|
||||
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_SUBSYSTEM_WINDOWS_USER) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU)
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_SUBSYSTEM_WINDOWS_USER) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_APPLE)
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
|
@ -334,11 +334,13 @@ create_frame_pred_vert_shader(struct vl_mpeg12_mc_renderer *r)
|
|||
free(tokens);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
create_field_pred_vert_shader(struct vl_mpeg12_mc_renderer *r)
|
||||
{
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
create_frame_pred_frag_shader(struct vl_mpeg12_mc_renderer *r)
|
||||
|
@ -442,11 +444,13 @@ create_frame_pred_frag_shader(struct vl_mpeg12_mc_renderer *r)
|
|||
free(tokens);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
create_field_pred_frag_shader(struct vl_mpeg12_mc_renderer *r)
|
||||
{
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
create_frame_bi_pred_vert_shader(struct vl_mpeg12_mc_renderer *r)
|
||||
|
@ -532,11 +536,13 @@ create_frame_bi_pred_vert_shader(struct vl_mpeg12_mc_renderer *r)
|
|||
free(tokens);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
create_field_bi_pred_vert_shader(struct vl_mpeg12_mc_renderer *r)
|
||||
{
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
create_frame_bi_pred_frag_shader(struct vl_mpeg12_mc_renderer *r)
|
||||
|
@ -658,11 +664,13 @@ create_frame_bi_pred_frag_shader(struct vl_mpeg12_mc_renderer *r)
|
|||
free(tokens);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static void
|
||||
create_field_bi_pred_frag_shader(struct vl_mpeg12_mc_renderer *r)
|
||||
{
|
||||
assert(false);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
xfer_buffers_map(struct vl_mpeg12_mc_renderer *r)
|
||||
|
@ -1081,6 +1089,9 @@ gen_macroblock_verts(struct vl_mpeg12_mc_renderer *r,
|
|||
assert(ycbcr_vb);
|
||||
assert(pos < r->macroblocks_per_batch);
|
||||
|
||||
mo_vec[1].x = 0;
|
||||
mo_vec[1].y = 0;
|
||||
|
||||
switch (mb->mb_type) {
|
||||
case PIPE_MPEG12_MACROBLOCK_TYPE_BI:
|
||||
{
|
||||
|
|
|
@ -111,6 +111,7 @@ i915_buffer_unmap(struct pipe_screen *screen,
|
|||
{
|
||||
struct i915_buffer *buf = i915_buffer(buffer);
|
||||
assert(!buf->ibuf);
|
||||
(void) buf;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -58,10 +58,10 @@ translate_wrap_mode(unsigned wrap)
|
|||
return TEXCOORDMODE_CLAMP_EDGE;
|
||||
case PIPE_TEX_WRAP_CLAMP_TO_BORDER:
|
||||
return TEXCOORDMODE_CLAMP_BORDER;
|
||||
/*
|
||||
/*
|
||||
case PIPE_TEX_WRAP_MIRRORED_REPEAT:
|
||||
return TEXCOORDMODE_MIRROR;
|
||||
*/
|
||||
*/
|
||||
default:
|
||||
return TEXCOORDMODE_WRAP;
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ lp_build_unpack_rgba_aos(LLVMBuilderRef builder,
|
|||
|
||||
shifted = LLVMBuildLShr(builder, packed, LLVMConstVector(shifts, 4), "");
|
||||
masked = LLVMBuildAnd(builder, shifted, LLVMConstVector(masks, 4), "");
|
||||
// UIToFP can't be expressed in SSE2
|
||||
/* UIToFP can't be expressed in SSE2 */
|
||||
casted = LLVMBuildSIToFP(builder, masked, LLVMVectorType(LLVMFloatType(), 4), "");
|
||||
|
||||
if (normalized)
|
||||
|
|
|
@ -321,7 +321,7 @@ emit_tex( struct lp_build_tgsi_soa_context *bld,
|
|||
{
|
||||
const uint unit = inst->Src[1].Register.Index;
|
||||
LLVMValueRef lodbias;
|
||||
LLVMValueRef oow;
|
||||
LLVMValueRef oow = NULL;
|
||||
LLVMValueRef coords[3];
|
||||
unsigned num_coords;
|
||||
unsigned i;
|
||||
|
@ -446,7 +446,12 @@ emit_instruction(
|
|||
{
|
||||
unsigned chan_index;
|
||||
LLVMValueRef src0, src1, src2;
|
||||
LLVMValueRef tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
|
||||
LLVMValueRef tmp0, tmp1, tmp2;
|
||||
LLVMValueRef tmp3 = NULL;
|
||||
LLVMValueRef tmp4 = NULL;
|
||||
LLVMValueRef tmp5 = NULL;
|
||||
LLVMValueRef tmp6 = NULL;
|
||||
LLVMValueRef tmp7 = NULL;
|
||||
LLVMValueRef res;
|
||||
LLVMValueRef dst0[NUM_CHANNELS];
|
||||
|
||||
|
|
|
@ -128,6 +128,7 @@ lp_vbuf_unmap_vertices(struct vbuf_render *vbr,
|
|||
{
|
||||
struct llvmpipe_vbuf_render *cvbr = llvmpipe_vbuf_render(vbr);
|
||||
assert( cvbr->vertex_buffer_size >= (max_index+1) * cvbr->vertex_size );
|
||||
(void) cvbr;
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
|
|
|
@ -693,6 +693,7 @@ llvmpipe_delete_fs_state(struct pipe_context *pipe, void *fs)
|
|||
struct lp_fragment_shader_variant *variant;
|
||||
|
||||
assert(fs != llvmpipe->fs);
|
||||
(void) llvmpipe;
|
||||
|
||||
variant = shader->variants;
|
||||
while(variant) {
|
||||
|
|
|
@ -115,7 +115,7 @@ extern const struct llvmpipe_cached_tex_tile *
|
|||
lp_find_cached_tex_tile(struct llvmpipe_tex_tile_cache *tc,
|
||||
union tex_tile_address addr );
|
||||
|
||||
static INLINE const union tex_tile_address
|
||||
static INLINE union tex_tile_address
|
||||
tex_tile_address( unsigned x,
|
||||
unsigned y,
|
||||
unsigned z,
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#define LP_TILE_SOA_H
|
||||
|
||||
#include "pipe/p_compiler.h"
|
||||
#include "tgsi/tgsi_exec.h" // for NUM_CHANNELS
|
||||
#include "tgsi/tgsi_exec.h" /* for NUM_CHANNELS */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#define LP_WINSYS_H
|
||||
|
||||
|
||||
#include "pipe/p_compiler.h" // for boolean
|
||||
#include "pipe/p_compiler.h" /* for boolean */
|
||||
#include "pipe/p_format.h"
|
||||
|
||||
|
||||
|
|
|
@ -128,6 +128,7 @@ sp_vbuf_unmap_vertices(struct vbuf_render *vbr,
|
|||
{
|
||||
struct softpipe_vbuf_render *cvbr = softpipe_vbuf_render(vbr);
|
||||
assert( cvbr->vertex_buffer_size >= (max_index+1) * cvbr->vertex_size );
|
||||
(void) cvbr;
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@ blend_quad(struct quad_stage *qs,
|
|||
static const float zero[4] = { 0, 0, 0, 0 };
|
||||
static const float one[4] = { 1, 1, 1, 1 };
|
||||
struct softpipe_context *softpipe = qs->softpipe;
|
||||
float source[4][QUAD_SIZE];
|
||||
float source[4][QUAD_SIZE] = { { 0 } };
|
||||
|
||||
/*
|
||||
* Compute src/first term RGB
|
||||
|
|
|
@ -52,6 +52,7 @@ trace_buffer_unwrap(struct trace_context *tr_ctx,
|
|||
|
||||
assert(tr_buf->buffer);
|
||||
assert(tr_buf->buffer->screen == tr_scr->screen);
|
||||
(void) tr_scr;
|
||||
return tr_buf->buffer;
|
||||
}
|
||||
|
||||
|
@ -90,6 +91,7 @@ trace_surface_unwrap(struct trace_context *tr_ctx,
|
|||
|
||||
assert(tr_surf->surface);
|
||||
assert(tr_surf->surface->texture->screen == tr_scr->screen);
|
||||
(void) tr_scr;
|
||||
return tr_surf->surface;
|
||||
}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
#include "pipe/p_config.h"
|
||||
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE)
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
|
@ -258,7 +258,7 @@ boolean trace_dump_trace_begin()
|
|||
trace_dump_writes("<?xml-stylesheet type='text/xsl' href='trace.xsl'?>\n");
|
||||
trace_dump_writes("<trace version='0.1'>\n");
|
||||
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS)
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_APPLE)
|
||||
/* Linux applications rarely cleanup GL / Gallium resources so catch
|
||||
* application exit here */
|
||||
atexit(trace_dump_trace_close);
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
|
||||
#if defined(PIPE_SUBSYSTEM_WINDOWS_USER)
|
||||
# define sleep Sleep
|
||||
#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD)
|
||||
#elif defined(PIPE_OS_LINUX) || defined(PIPE_OS_APPLE)
|
||||
void usleep(int);
|
||||
# define sleep usleep
|
||||
#else
|
||||
|
@ -180,7 +180,7 @@ static int
|
|||
trace_rbug_texture_info(struct trace_rbug *tr_rbug, struct rbug_header *header, uint32_t serial)
|
||||
{
|
||||
struct trace_screen *tr_scr = tr_rbug->tr_scr;
|
||||
struct trace_texture *tr_tex;
|
||||
struct trace_texture *tr_tex = NULL;
|
||||
struct rbug_proto_texture_info *gpti = (struct rbug_proto_texture_info *)header;
|
||||
struct tr_list *ptr;
|
||||
struct pipe_texture *t;
|
||||
|
@ -223,7 +223,7 @@ trace_rbug_texture_read(struct trace_rbug *tr_rbug, struct rbug_header *header,
|
|||
struct rbug_proto_texture_read *gptr = (struct rbug_proto_texture_read *)header;
|
||||
|
||||
struct trace_screen *tr_scr = tr_rbug->tr_scr;
|
||||
struct trace_texture *tr_tex;
|
||||
struct trace_texture *tr_tex = NULL;
|
||||
struct tr_list *ptr;
|
||||
|
||||
struct pipe_screen *screen = tr_scr->screen;
|
||||
|
|
|
@ -171,9 +171,9 @@ drm_takedown_shown_screen(_EGLDisplay *dpy, struct drm_screen *screen)
|
|||
drmModeSetCrtc(
|
||||
dev->drmFD,
|
||||
screen->crtcID,
|
||||
0, // FD
|
||||
0, /* FD */
|
||||
0, 0,
|
||||
NULL, 0, // List of output ids
|
||||
NULL, 0, /* List of output ids */
|
||||
NULL);
|
||||
|
||||
drmModeRmFB(dev->drmFD, screen->fbID);
|
||||
|
|
|
@ -152,6 +152,7 @@ drm_initialize(_EGLDriver *drv, _EGLDisplay *disp, EGLint *major, EGLint *minor)
|
|||
int num_screens = 0;
|
||||
EGLint i;
|
||||
int fd;
|
||||
_EGLConfig *config;
|
||||
|
||||
dev = (struct drm_device *) calloc(1, sizeof(struct drm_device));
|
||||
if (!dev)
|
||||
|
@ -206,7 +207,7 @@ drm_initialize(_EGLDriver *drv, _EGLDisplay *disp, EGLint *major, EGLint *minor)
|
|||
disp->DriverData = dev;
|
||||
|
||||
/* for now we only have one config */
|
||||
_EGLConfig *config = calloc(1, sizeof(*config));
|
||||
config = calloc(1, sizeof(*config));
|
||||
memset(config, 1, sizeof(*config));
|
||||
_eglInitConfig(config, 1);
|
||||
_eglSetConfigAttrib(config, EGL_RED_SIZE, 8);
|
||||
|
|
|
@ -644,6 +644,7 @@ register_with_display(Display *dpy)
|
|||
XExtCodes *c = XAddExtension(dpy);
|
||||
ext = dpy->ext_procs; /* new extension is at head of list */
|
||||
assert(c->extension == ext->codes.extension);
|
||||
(void) c;
|
||||
ext->name = _mesa_strdup(extName);
|
||||
ext->close_display = close_display_callback;
|
||||
}
|
||||
|
|
|
@ -164,8 +164,7 @@ void vgAppendPathData(VGPath dstPath,
|
|||
return;
|
||||
}
|
||||
for (i = 0; i < numSegments; ++i) {
|
||||
if (pathSegments[i] < VG_CLOSE_PATH ||
|
||||
pathSegments[i] > VG_LCWARC_TO_REL) {
|
||||
if (pathSegments[i] > VG_LCWARC_TO_REL) {
|
||||
vg_set_error(ctx, VG_ILLEGAL_ARGUMENT_ERROR);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -528,7 +528,6 @@ static INLINE int num_beziers_needed(struct arc *arc)
|
|||
double threshold = 0.05;
|
||||
VGboolean found = VG_FALSE;
|
||||
int n = 1;
|
||||
int i;
|
||||
double min_eta, max_eta;
|
||||
|
||||
min_eta = MIN2(arc->eta1, arc->eta2);
|
||||
|
@ -538,6 +537,7 @@ static INLINE int num_beziers_needed(struct arc *arc)
|
|||
double d_eta = (max_eta - min_eta) / n;
|
||||
if (d_eta <= 0.5 * M_PI) {
|
||||
double eta_b = min_eta;
|
||||
int i;
|
||||
found = VG_TRUE;
|
||||
for (i = 0; found && (i < n); ++i) {
|
||||
double etaA = eta_b;
|
||||
|
|
|
@ -256,7 +256,6 @@ static enum shift_result good_offset(const struct bezier *b1,
|
|||
const float max_dist_normal = threshold*offset;
|
||||
const float spacing = 0.25;
|
||||
float i;
|
||||
|
||||
for (i = spacing; i < 0.99; i += spacing) {
|
||||
float p1[2],p2[2], d, l;
|
||||
float normal[2];
|
||||
|
|
|
@ -476,7 +476,7 @@ static enum intersection_type line_intersect(const VGfloat *l1,
|
|||
const VGfloat *l2,
|
||||
float *intersection_point)
|
||||
{
|
||||
VGfloat isect[2];
|
||||
VGfloat isect[2] = { 0 };
|
||||
enum intersection_type type;
|
||||
VGboolean dx_zero, ldx_zero;
|
||||
|
||||
|
@ -649,7 +649,7 @@ static void create_joins(struct stroker *stroker,
|
|||
VGfloat prev_line[] = {stroker->back2_x, stroker->back2_y,
|
||||
stroker->back1_x, stroker->back1_y};
|
||||
|
||||
VGfloat isect[2];
|
||||
VGfloat isect[2] = { 0 };
|
||||
enum intersection_type type = line_intersect(prev_line, next_line, isect);
|
||||
|
||||
if (join == SquareJoin) {
|
||||
|
|
|
@ -71,6 +71,8 @@ struct crtc_private
|
|||
static void
|
||||
crtc_dpms(xf86CrtcPtr crtc, int mode)
|
||||
{
|
||||
/* ScrnInfoPtr pScrn = crtc->scrn; */
|
||||
|
||||
switch (mode) {
|
||||
case DPMSModeOn:
|
||||
case DPMSModeStandby:
|
||||
|
@ -147,18 +149,23 @@ crtc_gamma_set(xf86CrtcPtr crtc, CARD16 * red, CARD16 * green, CARD16 * blue,
|
|||
static void *
|
||||
crtc_shadow_allocate(xf86CrtcPtr crtc, int width, int height)
|
||||
{
|
||||
/* ScrnInfoPtr pScrn = crtc->scrn; */
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static PixmapPtr
|
||||
crtc_shadow_create(xf86CrtcPtr crtc, void *data, int width, int height)
|
||||
{
|
||||
/* ScrnInfoPtr pScrn = crtc->scrn; */
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
crtc_shadow_destroy(xf86CrtcPtr crtc, PixmapPtr rotate_pixmap, void *data)
|
||||
{
|
||||
/* ScrnInfoPtr pScrn = crtc->scrn; */
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -220,6 +220,12 @@ static Bool
|
|||
drv_init_resource_management(ScrnInfoPtr pScrn)
|
||||
{
|
||||
modesettingPtr ms = modesettingPTR(pScrn);
|
||||
/*
|
||||
ScreenPtr pScreen = pScrn->pScreen;
|
||||
PixmapPtr rootPixmap = pScreen->GetScreenPixmap(pScreen);
|
||||
Bool fbAccessDisabled;
|
||||
CARD8 *fbstart;
|
||||
*/
|
||||
|
||||
if (ms->screen || ms->kms)
|
||||
return TRUE;
|
||||
|
@ -249,9 +255,19 @@ static Bool
|
|||
drv_close_resource_management(ScrnInfoPtr pScrn)
|
||||
{
|
||||
modesettingPtr ms = modesettingPTR(pScrn);
|
||||
int i;
|
||||
|
||||
if (ms->screen)
|
||||
if (ms->screen) {
|
||||
assert(ms->ctx == NULL);
|
||||
|
||||
for (i = 0; i < XORG_NR_FENCES; i++) {
|
||||
if (ms->fence[i]) {
|
||||
ms->screen->fence_finish(ms->screen, ms->fence[i], 0);
|
||||
ms->screen->fence_reference(ms->screen, &ms->fence[i], NULL);
|
||||
}
|
||||
}
|
||||
ms->screen->destroy(ms->screen);
|
||||
}
|
||||
ms->screen = NULL;
|
||||
|
||||
if (ms->api && ms->api->destroy)
|
||||
|
@ -461,7 +477,7 @@ static void drv_block_handler(int i, pointer blockData, pointer pTimeout,
|
|||
* quite small. Let us get a fair way ahead of hardware before
|
||||
* throttling.
|
||||
*/
|
||||
for (j = 0; j < XORG_NR_FENCES; j++)
|
||||
for (j = 0; j < XORG_NR_FENCES - 1; j++)
|
||||
ms->screen->fence_reference(ms->screen,
|
||||
&ms->fence[j],
|
||||
ms->fence[j+1]);
|
||||
|
@ -915,6 +931,12 @@ drv_destroy_front_buffer_kms(ScrnInfoPtr pScrn)
|
|||
ScreenPtr pScreen = pScrn->pScreen;
|
||||
PixmapPtr rootPixmap = pScreen->GetScreenPixmap(pScreen);
|
||||
|
||||
/* XXX Do something with the rootPixmap.
|
||||
* This currently works fine but if we are getting crashes in
|
||||
* the fb functions after VT switches maybe look more into it.
|
||||
*/
|
||||
(void)rootPixmap;
|
||||
|
||||
if (!ms->root_bo)
|
||||
return TRUE;
|
||||
|
||||
|
|
|
@ -516,6 +516,7 @@ ExaCopy(PixmapPtr pDstPixmap, int srcX, int srcY, int dstX, int dstY,
|
|||
#endif
|
||||
|
||||
debug_assert(priv == exa->copy.dst);
|
||||
(void) priv;
|
||||
|
||||
if (exa->copy.use_surface_copy) {
|
||||
/* XXX: consider exposing >1 box in surface_copy interface.
|
||||
|
@ -1019,6 +1020,9 @@ xorg_exa_close(ScrnInfoPtr pScrn)
|
|||
|
||||
if (exa->pipe)
|
||||
exa->pipe->destroy(exa->pipe);
|
||||
exa->pipe = NULL;
|
||||
/* Since this was shared be proper with the pointer */
|
||||
ms->ctx = NULL;
|
||||
|
||||
exaDriverFini(pScrn->pScreen);
|
||||
xfree(exa);
|
||||
|
|
|
@ -47,22 +47,22 @@ static void
|
|||
print_fs_traits(int fs_traits)
|
||||
{
|
||||
const char *strings[] = {
|
||||
"FS_COMPOSITE", /* = 1 << 0 */
|
||||
"FS_MASK", /* = 1 << 1 */
|
||||
"FS_SOLID_FILL", /* = 1 << 2 */
|
||||
"FS_LINGRAD_FILL", /* = 1 << 3 */
|
||||
"FS_RADGRAD_FILL", /* = 1 << 4 */
|
||||
"FS_CA_FULL", /* = 1 << 5 - src.rgba * mask.rgba */
|
||||
"FS_CA_SRCALPHA", /* = 1 << 6 - src.aaaa * mask.rgba */
|
||||
"FS_YUV", /* = 1 << 7 */
|
||||
"FS_SRC_REPEAT_NONE", /* = 1 << 8 */
|
||||
"FS_MASK_REPEAT_NONE",/* = 1 << 9 */
|
||||
"FS_SRC_SWIZZLE_RGB", /* = 1 << 10 */
|
||||
"FS_MASK_SWIZZLE_RGB",/* = 1 << 11 */
|
||||
"FS_SRC_SET_ALPHA", /* = 1 << 12 */
|
||||
"FS_MASK_SET_ALPHA", /* = 1 << 13 */
|
||||
"FS_SRC_LUMINANCE", /* = 1 << 14 */
|
||||
"FS_MASK_LUMINANCE", /* = 1 << 15 */
|
||||
"FS_COMPOSITE", /* = 1 << 0, */
|
||||
"FS_MASK", /* = 1 << 1, */
|
||||
"FS_SOLID_FILL", /* = 1 << 2, */
|
||||
"FS_LINGRAD_FILL", /* = 1 << 3, */
|
||||
"FS_RADGRAD_FILL", /* = 1 << 4, */
|
||||
"FS_CA_FULL", /* = 1 << 5, */ /* src.rgba * mask.rgba */
|
||||
"FS_CA_SRCALPHA", /* = 1 << 6, */ /* src.aaaa * mask.rgba */
|
||||
"FS_YUV", /* = 1 << 7, */
|
||||
"FS_SRC_REPEAT_NONE", /* = 1 << 8, */
|
||||
"FS_MASK_REPEAT_NONE",/* = 1 << 9, */
|
||||
"FS_SRC_SWIZZLE_RGB", /* = 1 << 10, */
|
||||
"FS_MASK_SWIZZLE_RGB",/* = 1 << 11, */
|
||||
"FS_SRC_SET_ALPHA", /* = 1 << 12, */
|
||||
"FS_MASK_SET_ALPHA", /* = 1 << 13, */
|
||||
"FS_SRC_LUMINANCE", /* = 1 << 14, */
|
||||
"FS_MASK_LUMINANCE", /* = 1 << 15, */
|
||||
};
|
||||
int i, k;
|
||||
debug_printf("%s: ", __func__);
|
||||
|
@ -492,6 +492,7 @@ create_fs(struct pipe_context *pipe,
|
|||
|
||||
/* it has to be either a fill, a composite op or a yuv conversion */
|
||||
debug_assert((is_fill ^ is_composite) ^ is_yuv);
|
||||
(void) is_yuv;
|
||||
|
||||
out = ureg_DECL_output(ureg,
|
||||
TGSI_SEMANTIC_COLOR,
|
||||
|
|
|
@ -438,6 +438,7 @@ void renderer_copy_prepare(struct xorg_renderer *r,
|
|||
PIPE_TEXTURE_2D,
|
||||
PIPE_TEXTURE_USAGE_RENDER_TARGET,
|
||||
0));
|
||||
(void) screen;
|
||||
|
||||
|
||||
/* set misc state we care about */
|
||||
|
|
|
@ -0,0 +1,209 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
* without limitation the rights to use, copy, modify, merge, publish,
|
||||
* distribute, sub license, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
|
||||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
* USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the
|
||||
* next paragraph) shall be included in all copies or substantial portions
|
||||
* of the Software.
|
||||
*
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
/*
|
||||
* Authors:
|
||||
* Keith Whitwell
|
||||
* Brian Paul
|
||||
*/
|
||||
|
||||
|
||||
/* #include "glxheader.h" */
|
||||
/* #include "xmesaP.h" */
|
||||
|
||||
#include "pipe/internal/p_winsys_screen.h"
|
||||
#include "pipe/p_inlines.h"
|
||||
#include "util/u_math.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "i965simple/brw_winsys.h"
|
||||
#include "xlib_brw_aub.h"
|
||||
#include "xlib_brw.h"
|
||||
|
||||
|
||||
|
||||
|
||||
#define XBCWS_BATCHBUFFER_SIZE 1024
|
||||
|
||||
|
||||
/* The backend to the brw driver (ie struct brw_winsys) is actually a
|
||||
* per-context entity.
|
||||
*/
|
||||
struct xlib_brw_context_winsys {
|
||||
struct brw_winsys brw_context_winsys; /**< batch buffer funcs */
|
||||
struct aub_context *aub;
|
||||
|
||||
struct pipe_winsys *pipe_winsys;
|
||||
|
||||
unsigned batch_data[XBCWS_BATCHBUFFER_SIZE];
|
||||
unsigned batch_nr;
|
||||
unsigned batch_size;
|
||||
unsigned batch_alloc;
|
||||
};
|
||||
|
||||
|
||||
/* Turn a brw_winsys into an xlib_brw_context_winsys:
|
||||
*/
|
||||
static inline struct xlib_brw_context_winsys *
|
||||
xlib_brw_context_winsys( struct brw_winsys *sws )
|
||||
{
|
||||
return (struct xlib_brw_context_winsys *)sws;
|
||||
}
|
||||
|
||||
|
||||
/* Simple batchbuffer interface:
|
||||
*/
|
||||
|
||||
static unsigned *xbcws_batch_start( struct brw_winsys *sws,
|
||||
unsigned dwords,
|
||||
unsigned relocs )
|
||||
{
|
||||
struct xlib_brw_context_winsys *xbcws = xlib_brw_context_winsys(sws);
|
||||
|
||||
if (xbcws->batch_size < xbcws->batch_nr + dwords)
|
||||
return NULL;
|
||||
|
||||
xbcws->batch_alloc = xbcws->batch_nr + dwords;
|
||||
return (void *)1; /* not a valid pointer! */
|
||||
}
|
||||
|
||||
static void xbcws_batch_dword( struct brw_winsys *sws,
|
||||
unsigned dword )
|
||||
{
|
||||
struct xlib_brw_context_winsys *xbcws = xlib_brw_context_winsys(sws);
|
||||
|
||||
assert(xbcws->batch_nr < xbcws->batch_alloc);
|
||||
xbcws->batch_data[xbcws->batch_nr++] = dword;
|
||||
}
|
||||
|
||||
static void xbcws_batch_reloc( struct brw_winsys *sws,
|
||||
struct pipe_buffer *buf,
|
||||
unsigned access_flags,
|
||||
unsigned delta )
|
||||
{
|
||||
struct xlib_brw_context_winsys *xbcws = xlib_brw_context_winsys(sws);
|
||||
|
||||
assert(xbcws->batch_nr < xbcws->batch_alloc);
|
||||
xbcws->batch_data[xbcws->batch_nr++] =
|
||||
( xlib_brw_get_buffer_offset( NULL, buf, access_flags ) +
|
||||
delta );
|
||||
}
|
||||
|
||||
static void xbcws_batch_end( struct brw_winsys *sws )
|
||||
{
|
||||
struct xlib_brw_context_winsys *xbcws = xlib_brw_context_winsys(sws);
|
||||
|
||||
assert(xbcws->batch_nr <= xbcws->batch_alloc);
|
||||
xbcws->batch_alloc = 0;
|
||||
}
|
||||
|
||||
static void xbcws_batch_flush( struct brw_winsys *sws,
|
||||
struct pipe_fence_handle **fence )
|
||||
{
|
||||
struct xlib_brw_context_winsys *xbcws = xlib_brw_context_winsys(sws);
|
||||
assert(xbcws->batch_nr <= xbcws->batch_size);
|
||||
|
||||
if (xbcws->batch_nr) {
|
||||
xlib_brw_commands_aub( xbcws->pipe_winsys,
|
||||
xbcws->batch_data,
|
||||
xbcws->batch_nr );
|
||||
}
|
||||
|
||||
xbcws->batch_nr = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Really a per-device function, just pass through:
|
||||
*/
|
||||
static unsigned xbcws_get_buffer_offset( struct brw_winsys *sws,
|
||||
struct pipe_buffer *buf,
|
||||
unsigned access_flags )
|
||||
{
|
||||
struct xlib_brw_context_winsys *xbcws = xlib_brw_context_winsys(sws);
|
||||
|
||||
return xlib_brw_get_buffer_offset( xbcws->pipe_winsys,
|
||||
buf,
|
||||
access_flags );
|
||||
}
|
||||
|
||||
|
||||
/* Really a per-device function, just pass through:
|
||||
*/
|
||||
static void xbcws_buffer_subdata_typed( struct brw_winsys *sws,
|
||||
struct pipe_buffer *buf,
|
||||
unsigned long offset,
|
||||
unsigned long size,
|
||||
const void *data,
|
||||
unsigned data_type )
|
||||
{
|
||||
struct xlib_brw_context_winsys *xbcws = xlib_brw_context_winsys(sws);
|
||||
|
||||
xlib_brw_buffer_subdata_typed( xbcws->pipe_winsys,
|
||||
buf,
|
||||
offset,
|
||||
size,
|
||||
data,
|
||||
data_type );
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create i965 hardware rendering context, but plugged into a
|
||||
* dump-to-aubfile backend.
|
||||
*/
|
||||
struct pipe_context *
|
||||
xlib_create_brw_context( struct pipe_screen *screen,
|
||||
void *unused )
|
||||
{
|
||||
struct xlib_brw_context_winsys *xbcws = CALLOC_STRUCT( xlib_brw_context_winsys );
|
||||
|
||||
/* Fill in this struct with callbacks that i965simple will need to
|
||||
* communicate with the window system, buffer manager, etc.
|
||||
*/
|
||||
xbcws->brw_context_winsys.batch_start = xbcws_batch_start;
|
||||
xbcws->brw_context_winsys.batch_dword = xbcws_batch_dword;
|
||||
xbcws->brw_context_winsys.batch_reloc = xbcws_batch_reloc;
|
||||
xbcws->brw_context_winsys.batch_end = xbcws_batch_end;
|
||||
xbcws->brw_context_winsys.batch_flush = xbcws_batch_flush;
|
||||
xbcws->brw_context_winsys.buffer_subdata_typed = xbcws_buffer_subdata_typed;
|
||||
xbcws->brw_context_winsys.get_buffer_offset = xbcws_get_buffer_offset;
|
||||
|
||||
xbcws->pipe_winsys = screen->winsys; /* redundant */
|
||||
|
||||
xbcws->batch_size = XBCWS_BATCHBUFFER_SIZE;
|
||||
|
||||
/* Create the i965simple context:
|
||||
*/
|
||||
#ifdef GALLIUM_CELL
|
||||
return NULL;
|
||||
#else
|
||||
return brw_create( screen,
|
||||
&xbcws->brw_context_winsys,
|
||||
0 );
|
||||
#endif
|
||||
}
|
|
@ -37,7 +37,6 @@
|
|||
#define __gluarcsorter_h_
|
||||
|
||||
#include "sorter.h"
|
||||
#include "arcsorter.h"
|
||||
|
||||
class Arc;
|
||||
class Subdivider;
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
struct GridVertex {
|
||||
long gparam[2];
|
||||
GridVertex( void ) {}
|
||||
GridVertex( void ) { gparam[0] = 0, gparam[1] = 0; }
|
||||
GridVertex( long u, long v ) { gparam[0] = u, gparam[1] = v; }
|
||||
void set( long u, long v ) { gparam[0] = u, gparam[1] = v; }
|
||||
long nextu() { return gparam[0]++; }
|
||||
|
|
|
@ -106,7 +106,7 @@ struct O_nurbssurface : public PooledObj {
|
|||
int save; /* 1 if in display list */
|
||||
int used; /* 1 if prev called in block */
|
||||
O_nurbssurface( long _type )
|
||||
{ type = _type; owner = 0; next = 0; used = 0; }
|
||||
{ bezier_patches = 0; type = _type; owner = 0; next = 0; save = 0; used = 0; }
|
||||
};
|
||||
|
||||
struct O_surface : public PooledObj {
|
||||
|
|
|
@ -531,16 +531,18 @@ Subdivider::nonSamplingSplit(
|
|||
patchlist.pspec[param].range[1] ) * 0.5;
|
||||
split( source, left, right, param, mid );
|
||||
Patchlist subpatchlist( patchlist, param, mid );
|
||||
if( left.isnonempty() )
|
||||
if( left.isnonempty() ) {
|
||||
if( subpatchlist.cullCheck() == CULL_TRIVIAL_REJECT )
|
||||
freejarcs( left );
|
||||
else
|
||||
nonSamplingSplit( left, subpatchlist, subdivisions-1, param );
|
||||
if( right.isnonempty() )
|
||||
}
|
||||
if( right.isnonempty() ) {
|
||||
if( patchlist.cullCheck() == CULL_TRIVIAL_REJECT )
|
||||
freejarcs( right );
|
||||
else
|
||||
nonSamplingSplit( right, patchlist, subdivisions-1, param );
|
||||
}
|
||||
|
||||
} else {
|
||||
// make bbox calls
|
||||
|
|
|
@ -53,8 +53,16 @@ inline long sgn( REAL x )
|
|||
|
||||
Varray::Varray( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
varray = 0;
|
||||
size = 0;
|
||||
numquads = 0;
|
||||
|
||||
for (i = 0; i < 1000; i++) {
|
||||
vval[i] = 0;
|
||||
voffset[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
Varray::~Varray( void )
|
||||
|
|
|
@ -309,6 +309,8 @@ directedLine::directedLine()
|
|||
nextPolygon = NULL;
|
||||
rootBit = 0;/*important to initilzae to 0 meaning not root yet*/
|
||||
rootLink = NULL;
|
||||
direction = INCREASING;
|
||||
sline = NULL;
|
||||
}
|
||||
|
||||
directedLine::~directedLine()
|
||||
|
@ -791,22 +793,30 @@ directedLine* readAllPolygons(char* filename)
|
|||
{
|
||||
Int i,j;
|
||||
FILE* fp = fopen(filename, "r");
|
||||
assert(fp);
|
||||
Int nPolygons;
|
||||
fscanf(fp, "%i", &nPolygons);
|
||||
int result;
|
||||
|
||||
assert(fp);
|
||||
result = fscanf(fp, "%i", &nPolygons);
|
||||
assert(result != EOF);
|
||||
directedLine *ret = NULL;
|
||||
|
||||
for(i=0; i<nPolygons; i++)
|
||||
{
|
||||
Int nEdges;
|
||||
fscanf(fp, "%i", &nEdges);
|
||||
Real vert[2][2];
|
||||
result = fscanf(fp, "%i", &nEdges);
|
||||
assert(result != EOF);
|
||||
Real vert[2][2] = { { 0 } };
|
||||
Real VV[2][2];
|
||||
/*the first two vertices*/
|
||||
fscanf(fp, "%f", &(vert[0][0]));
|
||||
fscanf(fp, "%f", &(vert[0][1]));
|
||||
fscanf(fp, "%f", &(vert[1][0]));
|
||||
fscanf(fp, "%f", &(vert[1][1]));
|
||||
result = fscanf(fp, "%f", &(vert[0][0]));
|
||||
assert(result != EOF);
|
||||
result = fscanf(fp, "%f", &(vert[0][1]));
|
||||
assert(result != EOF);
|
||||
result = fscanf(fp, "%f", &(vert[1][0]));
|
||||
assert(result != EOF);
|
||||
result = fscanf(fp, "%f", &(vert[1][1]));
|
||||
assert(result != EOF);
|
||||
VV[1][0] = vert[0][0];
|
||||
VV[1][1] = vert[0][1];
|
||||
sampledLine *sLine = new sampledLine(2, vert);
|
||||
|
@ -818,8 +828,10 @@ thisPoly->rootLinkSet(NULL);
|
|||
{
|
||||
vert[0][0]=vert[1][0];
|
||||
vert[0][1]=vert[1][1];
|
||||
fscanf(fp, "%f", &(vert[1][0]));
|
||||
fscanf(fp, "%f", &(vert[1][1]));
|
||||
result = fscanf(fp, "%f", &(vert[1][0]));
|
||||
assert(result != EOF);
|
||||
result = fscanf(fp, "%f", &(vert[1][1]));
|
||||
assert(result != EOF);
|
||||
sLine = new sampledLine(2,vert);
|
||||
dLine = new directedLine(INCREASING, sLine);
|
||||
dLine->rootLinkSet(thisPoly);
|
||||
|
|
|
@ -127,6 +127,7 @@ monoChain::monoChain(directedLine* cHead, directedLine* cTail)
|
|||
current = chainTail;
|
||||
|
||||
isKey = 0;
|
||||
keyY = 0;
|
||||
}
|
||||
|
||||
//insert a new line between prev and this
|
||||
|
|
|
@ -111,8 +111,8 @@ Int isCusp(directedLine *v)
|
|||
else if(A[1] > B[1] && C[1] > B[1])
|
||||
return 1;
|
||||
|
||||
if(isAbove(v, v) && isAbove(v, v->getPrev()) ||
|
||||
isBelow(v, v) && isBelow(v, v->getPrev()))
|
||||
if((isAbove(v, v) && isAbove(v, v->getPrev())) ||
|
||||
(isBelow(v, v) && isBelow(v, v->getPrev())))
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
|
|
|
@ -207,7 +207,7 @@ void sampleBotRightWithGridLine(Real* botVertex,
|
|||
return;
|
||||
}
|
||||
|
||||
Int segIndexMono, segIndexPass;
|
||||
Int segIndexMono = 0, segIndexPass;
|
||||
findBotRightSegment(rightChain,
|
||||
rightEnd,
|
||||
rightCorner,
|
||||
|
@ -293,7 +293,7 @@ void sampleBotLeftWithGridLine(Real* botVertex,
|
|||
return;
|
||||
}
|
||||
|
||||
Int segIndexPass, segIndexMono;
|
||||
Int segIndexPass, segIndexMono = 0;
|
||||
findBotLeftSegment(leftChain, leftEnd, leftCorner, grid->get_u_value(leftU), segIndexMono, segIndexPass);
|
||||
|
||||
sampleBotLeftWithGridLinePost(botVertex,
|
||||
|
|
|
@ -172,7 +172,7 @@ void sampleTopRightWithGridLine(Real* topVertex,
|
|||
return;
|
||||
}
|
||||
|
||||
Int segIndexSmall, segIndexLarge;
|
||||
Int segIndexSmall = 0, segIndexLarge;
|
||||
findTopRightSegment(rightChain,
|
||||
rightStart,
|
||||
rightEnd,
|
||||
|
@ -294,7 +294,7 @@ void sampleTopLeftWithGridLine(Real* topVertex,
|
|||
primStream* pStream
|
||||
)
|
||||
{
|
||||
Int segIndexSmall, segIndexLarge;
|
||||
Int segIndexSmall = 0, segIndexLarge;
|
||||
//if left chain is empty, then there is only one top vertex with one grid
|
||||
// line
|
||||
if(leftEnd < leftStart) {
|
||||
|
|
|
@ -107,6 +107,9 @@ sampledLine::sampledLine(Real pt1[2], Real pt2[2])
|
|||
//needs tp call init to setup
|
||||
sampledLine::sampledLine()
|
||||
{
|
||||
npoints = 0;
|
||||
points = NULL;
|
||||
next = NULL;
|
||||
}
|
||||
|
||||
//warning: ONLY pointer is copies!!!
|
||||
|
|
|
@ -31,6 +31,8 @@
|
|||
*/
|
||||
|
||||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
|
||||
#define NEED_REPLIES
|
||||
#include <X11/Xlibint.h>
|
||||
#include <X11/extensions/Xext.h>
|
||||
|
@ -377,3 +379,5 @@ DRI2CopyRegion(Display * dpy, XID drawable, XserverRegion region,
|
|||
UnlockDisplay(dpy);
|
||||
SyncHandle();
|
||||
}
|
||||
|
||||
#endif /* GLX_DIRECT_RENDERING */
|
||||
|
|
|
@ -150,8 +150,9 @@ FreeScreenConfigs(__GLXdisplayPrivate * priv)
|
|||
|
||||
#ifdef GLX_DIRECT_RENDERING
|
||||
if (psc->driver_configs) {
|
||||
for (unsigned int i = 0; psc->driver_configs[i]; i++)
|
||||
free((__DRIconfig *) psc->driver_configs[i]);
|
||||
unsigned int j;
|
||||
for (j = 0; psc->driver_configs[j]; j++)
|
||||
free((__DRIconfig *) psc->driver_configs[j]);
|
||||
free(psc->driver_configs);
|
||||
psc->driver_configs = NULL;
|
||||
}
|
||||
|
|
|
@ -115,6 +115,10 @@ Bool XF86DRIGetDeviceInfo(Display * dpy, int screen,
|
|||
int *fbSize, int *fbStride, int *devPrivateSize,
|
||||
void **pDevPrivate);
|
||||
|
||||
Bool XF86DRIOpenFullScreen(Display * dpy, int screen, Drawable drawable);
|
||||
|
||||
Bool XF86DRICloseFullScreen(Display * dpy, int screen, Drawable drawable);
|
||||
|
||||
_XFUNCPROTOEND
|
||||
#endif /* _XF86DRI_SERVER_ */
|
||||
#endif /* _XF86DRI_H_ */
|
||||
|
|
|
@ -352,7 +352,7 @@ static struct {
|
|||
#define LOCAL_VARS(n) \
|
||||
ffbContextPtr fmesa = FFB_CONTEXT(ctx); \
|
||||
__DRIdrawablePrivate *dPriv = fmesa->driDrawable; \
|
||||
ffb_color color[n]; \
|
||||
ffb_color color[n] = { { 0 } }; \
|
||||
(void) color; (void) dPriv;
|
||||
|
||||
/***********************************************************************
|
||||
|
|
|
@ -245,7 +245,7 @@ GLuint i915_emit_texld( struct i915_fragment_program *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)));
|
||||
/* Can't use unsaved temps for coords, as the phase boundary would result
|
||||
* in the contents becoming undefined.
|
||||
*/
|
||||
|
|
|
@ -117,7 +117,7 @@ intelDmaPrimitive(struct intel_context *intel, GLenum prim)
|
|||
intel_set_prim(intel, hw_prim[prim]);
|
||||
}
|
||||
|
||||
static inline GLuint intel_get_vb_max(struct intel_context *intel)
|
||||
static INLINE GLuint intel_get_vb_max(struct intel_context *intel)
|
||||
{
|
||||
GLuint ret;
|
||||
|
||||
|
@ -129,7 +129,7 @@ static inline GLuint intel_get_vb_max(struct intel_context *intel)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static inline GLuint intel_get_current_max(struct intel_context *intel)
|
||||
static INLINE GLuint intel_get_current_max(struct intel_context *intel)
|
||||
{
|
||||
|
||||
if (intel->intelScreen->no_vbo)
|
||||
|
|
|
@ -365,6 +365,7 @@ static int format (FILE *f, char *format, ...)
|
|||
va_start (args, format);
|
||||
|
||||
vsnprintf (buf, sizeof (buf) - 1, format, args);
|
||||
va_end (args);
|
||||
string (f, buf);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -199,7 +199,7 @@ void brw_set_src1( struct brw_instruction *insn,
|
|||
* in the future:
|
||||
*/
|
||||
assert (reg.address_mode == BRW_ADDRESS_DIRECT);
|
||||
//assert (reg.file == BRW_GENERAL_REGISTER_FILE);
|
||||
/* assert (reg.file == BRW_GENERAL_REGISTER_FILE); */
|
||||
|
||||
if (insn->header.access_mode == BRW_ALIGN_1) {
|
||||
insn->bits3.da1.src1_subreg_nr = reg.subnr;
|
||||
|
@ -862,7 +862,7 @@ void brw_land_fwd_jump(struct brw_compile *p,
|
|||
jmpi = 2;
|
||||
|
||||
assert(jmp_insn->header.opcode == BRW_OPCODE_JMPI);
|
||||
assert(jmp_insn->bits1.da1.src1_reg_file = BRW_IMMEDIATE_VALUE);
|
||||
assert(jmp_insn->bits1.da1.src1_reg_file == BRW_IMMEDIATE_VALUE);
|
||||
|
||||
jmp_insn->bits3.ud = jmpi * ((landing - jmp_insn) - 1);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
#include "brw_context.h"
|
||||
|
||||
static inline void
|
||||
static INLINE void
|
||||
brw_add_validated_bo(struct brw_context *brw, dri_bo *bo)
|
||||
{
|
||||
assert(brw->state.validated_bo_count < ARRAY_SIZE(brw->state.validated_bos));
|
||||
|
|
|
@ -1086,7 +1086,7 @@ static void emit_kil_nv( struct brw_wm_compile *c )
|
|||
|
||||
brw_push_insn_state(p);
|
||||
brw_set_mask_control(p, BRW_MASK_DISABLE);
|
||||
brw_NOT(p, c->emit_mask_reg, brw_mask_reg(1)); //IMASK
|
||||
brw_NOT(p, c->emit_mask_reg, brw_mask_reg(1)); /* IMASK */
|
||||
brw_AND(p, r0uw, c->emit_mask_reg, r0uw);
|
||||
brw_pop_insn_state(p);
|
||||
}
|
||||
|
|
|
@ -743,7 +743,7 @@ static void emit_kil(struct brw_wm_compile *c)
|
|||
struct brw_reg depth = retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_UW);
|
||||
brw_push_insn_state(p);
|
||||
brw_set_mask_control(p, BRW_MASK_DISABLE);
|
||||
brw_NOT(p, c->emit_mask_reg, brw_mask_reg(1)); //IMASK
|
||||
brw_NOT(p, c->emit_mask_reg, brw_mask_reg(1)); /* IMASK */
|
||||
brw_AND(p, depth, c->emit_mask_reg, depth);
|
||||
brw_pop_insn_state(p);
|
||||
}
|
||||
|
|
|
@ -335,14 +335,14 @@ extern char *__progname;
|
|||
#define ALIGN(value, alignment) ((value + alignment - 1) & ~(alignment - 1))
|
||||
#define IS_POWER_OF_TWO(val) (((val) & (val - 1)) == 0)
|
||||
|
||||
static inline uint32_t
|
||||
static INLINE uint32_t
|
||||
U_FIXED(float value, uint32_t frac_bits)
|
||||
{
|
||||
value *= (1 << frac_bits);
|
||||
return value < 0 ? 0 : value;
|
||||
}
|
||||
|
||||
static inline uint32_t
|
||||
static INLINE uint32_t
|
||||
S_FIXED(float value, uint32_t frac_bits)
|
||||
{
|
||||
return value * (1 << frac_bits);
|
||||
|
@ -546,7 +546,7 @@ is_power_of_two(uint32_t value)
|
|||
return (value & (value - 1)) == 0;
|
||||
}
|
||||
|
||||
static inline void
|
||||
static INLINE void
|
||||
intel_bo_map_gtt_preferred(struct intel_context *intel,
|
||||
drm_intel_bo *bo,
|
||||
GLboolean write)
|
||||
|
@ -557,7 +557,7 @@ intel_bo_map_gtt_preferred(struct intel_context *intel,
|
|||
drm_intel_bo_map(bo, write);
|
||||
}
|
||||
|
||||
static inline void
|
||||
static INLINE void
|
||||
intel_bo_unmap_gtt_preferred(struct intel_context *intel,
|
||||
drm_intel_bo *bo)
|
||||
{
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include "main/mtypes.h"
|
||||
#include "main/macros.h"
|
||||
#include "main/bufferobj.h"
|
||||
#include "main/polygon.h"
|
||||
#include "main/pixelstore.h"
|
||||
#include "main/polygon.h"
|
||||
#include "main/state.h"
|
||||
|
@ -165,7 +166,7 @@ static GLuint get_bitmap_rect(GLsizei width, GLsizei height,
|
|||
* Returns the low Y value of the vertical range given, flipped according to
|
||||
* whether the framebuffer is or not.
|
||||
*/
|
||||
static inline int
|
||||
static INLINE int
|
||||
y_flip(struct gl_framebuffer *fb, int y, int height)
|
||||
{
|
||||
if (fb->Name != 0)
|
||||
|
|
|
@ -109,7 +109,7 @@ do_copy_texsubimage(struct intel_context *intel,
|
|||
return GL_FALSE;
|
||||
}
|
||||
|
||||
// intelFlush(ctx);
|
||||
/* intelFlush(ctx); */
|
||||
LOCK_HARDWARE(intel);
|
||||
{
|
||||
drm_intel_bo *dst_bo = intel_region_buffer(intel,
|
||||
|
|
|
@ -1572,7 +1572,7 @@ tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target,
|
|||
tdfxTexInfo *ti;
|
||||
tdfxMipMapLevel *mml;
|
||||
gl_format mesaFormat;
|
||||
GLuint compressedSize;
|
||||
GLuint compressedSize = 0;
|
||||
|
||||
if (TDFX_DEBUG & DEBUG_VERBOSE_DRI) {
|
||||
fprintf(stderr, "tdfxCompressedTexImage2D: id=%d int 0x%x %dx%d\n",
|
||||
|
|
|
@ -910,6 +910,7 @@ _mesa_test_formats(void)
|
|||
GLuint t = info->RedBits + info->GreenBits
|
||||
+ info->BlueBits + info->AlphaBits;
|
||||
assert(t / 8 == info->BytesPerBlock);
|
||||
(void) t;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ get_tex_color_index(GLcontext *ctx, GLuint dimensions,
|
|||
|
||||
for (img = 0; img < depth; img++) {
|
||||
for (row = 0; row < height; row++) {
|
||||
GLuint indexRow[MAX_WIDTH];
|
||||
GLuint indexRow[MAX_WIDTH] = { 0 };
|
||||
void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels,
|
||||
width, height, format, type,
|
||||
img, row, 0);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -154,7 +154,7 @@ typedef union YYSTYPE
|
|||
{
|
||||
|
||||
/* Line 1676 of yacc.c */
|
||||
#line 122 "program_parse.y"
|
||||
#line 125 "program_parse.y"
|
||||
|
||||
struct asm_instruction *inst;
|
||||
struct asm_symbol *sym;
|
||||
|
|
|
@ -74,6 +74,9 @@ static void init_src_reg(struct asm_src_register *r);
|
|||
static void set_src_reg(struct asm_src_register *r,
|
||||
gl_register_file file, GLint index);
|
||||
|
||||
static void set_src_reg_swz(struct asm_src_register *r,
|
||||
gl_register_file file, GLint index, GLuint swizzle);
|
||||
|
||||
static void asm_instruction_set_operands(struct asm_instruction *inst,
|
||||
const struct prog_dst_register *dst, const struct asm_src_register *src0,
|
||||
const struct asm_src_register *src1, const struct asm_src_register *src2);
|
||||
|
@ -588,7 +591,9 @@ scalarUse: srcReg scalarSuffix
|
|||
temp_sym.param_binding_begin = ~0;
|
||||
initialize_symbol_from_const(state->prog, & temp_sym, & $1);
|
||||
|
||||
set_src_reg(& $$, PROGRAM_CONSTANT, temp_sym.param_binding_begin);
|
||||
set_src_reg_swz(& $$, PROGRAM_CONSTANT,
|
||||
temp_sym.param_binding_begin,
|
||||
temp_sym.param_binding_swizzle);
|
||||
}
|
||||
;
|
||||
|
||||
|
@ -790,7 +795,9 @@ srcReg: USED_IDENTIFIER /* temporaryReg | progParamSingle */
|
|||
set_src_reg(& $$, PROGRAM_TEMPORARY, s->temp_binding);
|
||||
break;
|
||||
case at_param:
|
||||
set_src_reg(& $$, s->param_binding_type, s->param_binding_begin);
|
||||
set_src_reg_swz(& $$, s->param_binding_type,
|
||||
s->param_binding_begin,
|
||||
s->param_binding_swizzle);
|
||||
break;
|
||||
case at_attrib:
|
||||
set_src_reg(& $$, PROGRAM_INPUT, s->attrib_binding);
|
||||
|
@ -841,7 +848,8 @@ srcReg: USED_IDENTIFIER /* temporaryReg | progParamSingle */
|
|||
gl_register_file file = ($1.name != NULL)
|
||||
? $1.param_binding_type
|
||||
: PROGRAM_CONSTANT;
|
||||
set_src_reg(& $$, file, $1.param_binding_begin);
|
||||
set_src_reg_swz(& $$, file, $1.param_binding_begin,
|
||||
$1.param_binding_swizzle);
|
||||
}
|
||||
;
|
||||
|
||||
|
@ -1210,6 +1218,7 @@ PARAM_singleStmt: PARAM IDENTIFIER paramSingleInit
|
|||
s->param_binding_type = $3.param_binding_type;
|
||||
s->param_binding_begin = $3.param_binding_begin;
|
||||
s->param_binding_length = $3.param_binding_length;
|
||||
s->param_binding_swizzle = SWIZZLE_XYZW;
|
||||
s->param_is_array = 0;
|
||||
}
|
||||
}
|
||||
|
@ -1233,6 +1242,7 @@ PARAM_multipleStmt: PARAM IDENTIFIER '[' optArraySize ']' paramMultipleInit
|
|||
s->param_binding_type = $6.param_binding_type;
|
||||
s->param_binding_begin = $6.param_binding_begin;
|
||||
s->param_binding_length = $6.param_binding_length;
|
||||
s->param_binding_swizzle = SWIZZLE_XYZW;
|
||||
s->param_is_array = 1;
|
||||
}
|
||||
}
|
||||
|
@ -2310,19 +2320,29 @@ init_src_reg(struct asm_src_register *r)
|
|||
}
|
||||
|
||||
|
||||
/** Like init_src_reg() but set the File and Index fields. */
|
||||
/** Like init_src_reg() but set the File and Index fields.
|
||||
* \return GL_TRUE if a valid src register, GL_FALSE otherwise
|
||||
*/
|
||||
void
|
||||
set_src_reg(struct asm_src_register *r, gl_register_file file, GLint index)
|
||||
{
|
||||
set_src_reg_swz(r, file, index, SWIZZLE_XYZW);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
set_src_reg_swz(struct asm_src_register *r, gl_register_file file, GLint index,
|
||||
GLuint swizzle)
|
||||
{
|
||||
const GLint maxIndex = (1 << INST_INDEX_BITS) - 1;
|
||||
const GLint minIndex = -(1 << INST_INDEX_BITS);
|
||||
ASSERT(file < PROGRAM_FILE_MAX);
|
||||
ASSERT(index >= minIndex);
|
||||
ASSERT(index <= maxIndex);
|
||||
ASSERT(file < PROGRAM_FILE_MAX);
|
||||
memset(r, 0, sizeof(*r));
|
||||
r->Base.File = file;
|
||||
r->Base.Index = index;
|
||||
r->Base.Swizzle = SWIZZLE_NOOP;
|
||||
r->Base.Swizzle = swizzle;
|
||||
r->Symbol = NULL;
|
||||
}
|
||||
|
||||
|
@ -2454,15 +2474,20 @@ initialize_symbol_from_state(struct gl_program *prog,
|
|||
state_tokens[2] = state_tokens[3] = row;
|
||||
|
||||
idx = add_state_reference(prog->Parameters, state_tokens);
|
||||
if (param_var->param_binding_begin == ~0U)
|
||||
if (param_var->param_binding_begin == ~0U) {
|
||||
param_var->param_binding_begin = idx;
|
||||
param_var->param_binding_swizzle = SWIZZLE_XYZW;
|
||||
}
|
||||
|
||||
param_var->param_binding_length++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
idx = add_state_reference(prog->Parameters, state_tokens);
|
||||
if (param_var->param_binding_begin == ~0U)
|
||||
if (param_var->param_binding_begin == ~0U) {
|
||||
param_var->param_binding_begin = idx;
|
||||
param_var->param_binding_swizzle = SWIZZLE_XYZW;
|
||||
}
|
||||
param_var->param_binding_length++;
|
||||
}
|
||||
|
||||
|
@ -2502,15 +2527,19 @@ initialize_symbol_from_param(struct gl_program *prog,
|
|||
state_tokens[2] = state_tokens[3] = row;
|
||||
|
||||
idx = add_state_reference(prog->Parameters, state_tokens);
|
||||
if (param_var->param_binding_begin == ~0U)
|
||||
if (param_var->param_binding_begin == ~0U) {
|
||||
param_var->param_binding_begin = idx;
|
||||
param_var->param_binding_swizzle = SWIZZLE_XYZW;
|
||||
}
|
||||
param_var->param_binding_length++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
idx = add_state_reference(prog->Parameters, state_tokens);
|
||||
if (param_var->param_binding_begin == ~0U)
|
||||
if (param_var->param_binding_begin == ~0U) {
|
||||
param_var->param_binding_begin = idx;
|
||||
param_var->param_binding_swizzle = SWIZZLE_XYZW;
|
||||
}
|
||||
param_var->param_binding_length++;
|
||||
}
|
||||
|
||||
|
@ -2518,20 +2547,29 @@ initialize_symbol_from_param(struct gl_program *prog,
|
|||
}
|
||||
|
||||
|
||||
/**
|
||||
* Put a float/vector constant/literal into the parameter list.
|
||||
* \param param_var returns info about the parameter/constant's location,
|
||||
* binding, type, etc.
|
||||
* \param vec the vector/constant to add
|
||||
* \return index of the constant in the parameter list.
|
||||
*/
|
||||
int
|
||||
initialize_symbol_from_const(struct gl_program *prog,
|
||||
struct asm_symbol *param_var,
|
||||
const struct asm_vector *vec)
|
||||
{
|
||||
const int idx = _mesa_add_parameter(prog->Parameters, PROGRAM_CONSTANT,
|
||||
NULL, vec->count, GL_NONE, vec->data,
|
||||
NULL, 0x0);
|
||||
unsigned swizzle;
|
||||
const int idx = _mesa_add_unnamed_constant(prog->Parameters,
|
||||
vec->data, vec->count, &swizzle);
|
||||
|
||||
param_var->type = at_param;
|
||||
param_var->param_binding_type = PROGRAM_CONSTANT;
|
||||
|
||||
if (param_var->param_binding_begin == ~0U)
|
||||
if (param_var->param_binding_begin == ~0U) {
|
||||
param_var->param_binding_begin = idx;
|
||||
param_var->param_binding_swizzle = swizzle;
|
||||
}
|
||||
param_var->param_binding_length++;
|
||||
|
||||
return idx;
|
||||
|
|
|
@ -56,6 +56,12 @@ struct asm_symbol {
|
|||
*/
|
||||
unsigned param_binding_begin;
|
||||
|
||||
/**
|
||||
* Constants put into the parameter list may be swizzled. This
|
||||
* field contain's the symbol's swizzle. (SWIZZLE_X/Y/Z/W)
|
||||
*/
|
||||
unsigned param_binding_swizzle;
|
||||
|
||||
/* This is how many entries in the the program_parameter_list we take up
|
||||
* with our state tokens or constants. Note that this is _not_ the same as
|
||||
* the number of param registers we eventually use.
|
||||
|
|
|
@ -3763,6 +3763,14 @@ _slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var,
|
|||
#endif
|
||||
}
|
||||
|
||||
if (var->type.qualifier == SLANG_QUAL_UNIFORM &&
|
||||
!A->allow_uniform_initializers) {
|
||||
slang_info_log_error(A->log,
|
||||
"initializer for uniform %s not allowed",
|
||||
varName);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* IR for the variable we're initializing */
|
||||
varRef = new_var(A, var);
|
||||
if (!varRef) {
|
||||
|
|
|
@ -42,6 +42,7 @@ typedef struct slang_assemble_ctx_
|
|||
struct gl_sl_pragmas *pragmas;
|
||||
slang_var_table *vartable;
|
||||
slang_info_log *log;
|
||||
GLboolean allow_uniform_initializers;
|
||||
|
||||
/* current loop stack */
|
||||
const slang_operation *LoopOperStack[MAX_LOOP_DEPTH];
|
||||
|
|
|
@ -2143,6 +2143,7 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
|
|||
if (C->global_scope) {
|
||||
slang_assemble_ctx A;
|
||||
memset(&A, 0, sizeof(slang_assemble_ctx));
|
||||
A.allow_uniform_initializers = C->version > 110;
|
||||
A.atoms = C->atoms;
|
||||
A.space.funcs = O->funs;
|
||||
A.space.structs = O->structs;
|
||||
|
@ -2162,6 +2163,7 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O,
|
|||
if (var->initializer != NULL) {
|
||||
slang_assemble_ctx A;
|
||||
memset(&A, 0, sizeof(slang_assemble_ctx));
|
||||
A.allow_uniform_initializers = C->version > 110;
|
||||
A.atoms = C->atoms;
|
||||
A.space.funcs = O->funs;
|
||||
A.space.structs = O->structs;
|
||||
|
@ -2519,6 +2521,7 @@ parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit,
|
|||
A.vartable = o.vartable;
|
||||
A.EmitContReturn = ctx->Shader.EmitContReturn;
|
||||
A.log = C->L;
|
||||
A.allow_uniform_initializers = C->version > 110;
|
||||
|
||||
/* main() takes no parameters */
|
||||
if (mainFunc->param_count > 0) {
|
||||
|
|
|
@ -46,6 +46,7 @@ slang_operation_construct(slang_operation * oper)
|
|||
oper->literal_size = 1;
|
||||
oper->array_constructor = GL_FALSE;
|
||||
oper->a_id = SLANG_ATOM_NULL;
|
||||
oper->a_obj = SLANG_ATOM_NULL;
|
||||
oper->locals = _slang_variable_scope_new(NULL);
|
||||
if (oper->locals == NULL)
|
||||
return GL_FALSE;
|
||||
|
|
|
@ -93,7 +93,8 @@ st_get_format_info(enum pipe_format format, struct pipe_format_info *pinfo)
|
|||
if (format == PIPE_FORMAT_A1R5G5B5_UNORM || format == PIPE_FORMAT_R5G6B5_UNORM) {
|
||||
pinfo->datatype = GL_UNSIGNED_SHORT;
|
||||
}
|
||||
else if (format == PIPE_FORMAT_S8Z24_UNORM) {
|
||||
else if (format == PIPE_FORMAT_S8Z24_UNORM ||
|
||||
format == PIPE_FORMAT_Z24S8_UNORM) {
|
||||
pinfo->datatype = GL_UNSIGNED_INT_24_8;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1766,9 +1766,7 @@ _swrast_get_row(GLcontext *ctx, struct gl_renderbuffer *rb,
|
|||
|
||||
|
||||
/**
|
||||
* Get RGBA pixels from the given renderbuffer. Put the pixel colors into
|
||||
* the span's specular color arrays. The specular color arrays should no
|
||||
* longer be needed by time this function is called.
|
||||
* Get RGBA pixels from the given renderbuffer.
|
||||
* Used by blending, logicop and masking functions.
|
||||
* \return pointer to the colors we read.
|
||||
*/
|
||||
|
@ -1779,10 +1777,8 @@ _swrast_get_dest_rgba(GLcontext *ctx, struct gl_renderbuffer *rb,
|
|||
const GLuint pixelSize = RGBA_PIXEL_SIZE(span->array->ChanType);
|
||||
void *rbPixels;
|
||||
|
||||
/*
|
||||
* Point rbPixels to a temporary space (use specular color arrays).
|
||||
*/
|
||||
rbPixels = span->array->attribs[FRAG_ATTRIB_COL1];
|
||||
/* Point rbPixels to a temporary space */
|
||||
rbPixels = span->array->attribs[FRAG_ATTRIB_MAX - 1];
|
||||
|
||||
/* Get destination values from renderbuffer */
|
||||
if (span->arrayMask & SPAN_XY) {
|
||||
|
|
Loading…
Reference in New Issue