diff options
Diffstat (limited to 'src')
74 files changed, 795 insertions, 398 deletions
diff --git a/src/gallium/auxiliary/rbug/rbug_context.h b/src/gallium/auxiliary/rbug/rbug_context.h index da61c2365b0..03126d6b123 100644 --- a/src/gallium/auxiliary/rbug/rbug_context.h +++ b/src/gallium/auxiliary/rbug/rbug_context.h @@ -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 diff --git a/src/gallium/auxiliary/rbug/rbug_proto.h b/src/gallium/auxiliary/rbug/rbug_proto.h index d273be0166d..4f3eb75dc4d 100644 --- a/src/gallium/auxiliary/rbug/rbug_proto.h +++ b/src/gallium/auxiliary/rbug/rbug_proto.h @@ -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 }; /** diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c index 1e730e53427..6a0af664dd4 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c @@ -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; diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index 4e01123fff1..9b4e6ca2a73 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -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) diff --git a/src/gallium/auxiliary/util/u_debug.h b/src/gallium/auxiliary/util/u_debug.h index abd834c741a..facc30a5534 100644 --- a/src/gallium/auxiliary/util/u_debug.h +++ b/src/gallium/auxiliary/util/u_debug.h @@ -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 diff --git a/src/gallium/auxiliary/util/u_network.c b/src/gallium/auxiliary/util/u_network.c index 6269c72e121..9eb8f309cd1 100644 --- a/src/gallium/auxiliary/util/u_network.c +++ b/src/gallium/auxiliary/util/u_network.c @@ -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; diff --git a/src/gallium/auxiliary/util/u_network.h b/src/gallium/auxiliary/util/u_network.h index 0aa898b9676..187dcab86e7 100644 --- a/src/gallium/auxiliary/util/u_network.h +++ b/src/gallium/auxiliary/util/u_network.h @@ -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 diff --git a/src/gallium/auxiliary/util/u_stream_stdc.c b/src/gallium/auxiliary/util/u_stream_stdc.c index 5cd05b29047..4d976d6dca4 100644 --- a/src/gallium/auxiliary/util/u_stream_stdc.c +++ b/src/gallium/auxiliary/util/u_stream_stdc.c @@ -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> diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c index ab196c21f87..caf581aca60 100644 --- a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c +++ b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c @@ -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: { diff --git a/src/gallium/drivers/i915/i915_buffer.c b/src/gallium/drivers/i915/i915_buffer.c index effeba12972..669964770d4 100644 --- a/src/gallium/drivers/i915/i915_buffer.c +++ b/src/gallium/drivers/i915/i915_buffer.c @@ -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 diff --git a/src/gallium/drivers/i915/i915_state.c b/src/gallium/drivers/i915/i915_state.c index e580b6c0f7f..1528afc8599 100644 --- a/src/gallium/drivers/i915/i915_state.c +++ b/src/gallium/drivers/i915/i915_state.c @@ -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; } diff --git a/src/gallium/drivers/llvmpipe/lp_bld_format_aos.c b/src/gallium/drivers/llvmpipe/lp_bld_format_aos.c index 5836e0173f9..10e82f120bb 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_format_aos.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_format_aos.c @@ -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) diff --git a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c index a67c70ff25a..7cfa4cc59a6 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c @@ -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]; diff --git a/src/gallium/drivers/llvmpipe/lp_prim_vbuf.c b/src/gallium/drivers/llvmpipe/lp_prim_vbuf.c index 4abff4ecccc..e8e2e2524ac 100644 --- a/src/gallium/drivers/llvmpipe/lp_prim_vbuf.c +++ b/src/gallium/drivers/llvmpipe/lp_prim_vbuf.c @@ -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 */ } diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index 3e8f595e994..f2b8c362644 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -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) { diff --git a/src/gallium/drivers/llvmpipe/lp_tex_cache.h b/src/gallium/drivers/llvmpipe/lp_tex_cache.h index 9fa6c368125..05fded78e16 100644 --- a/src/gallium/drivers/llvmpipe/lp_tex_cache.h +++ b/src/gallium/drivers/llvmpipe/lp_tex_cache.h @@ -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, diff --git a/src/gallium/drivers/llvmpipe/lp_tile_soa.h b/src/gallium/drivers/llvmpipe/lp_tile_soa.h index 040b01865dd..19d00b58d37 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_soa.h +++ b/src/gallium/drivers/llvmpipe/lp_tile_soa.h @@ -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 diff --git a/src/gallium/drivers/llvmpipe/lp_winsys.h b/src/gallium/drivers/llvmpipe/lp_winsys.h index 595481c2cbc..74b472b6531 100644 --- a/src/gallium/drivers/llvmpipe/lp_winsys.h +++ b/src/gallium/drivers/llvmpipe/lp_winsys.h @@ -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" diff --git a/src/gallium/drivers/softpipe/sp_prim_vbuf.c b/src/gallium/drivers/softpipe/sp_prim_vbuf.c index 5fbac06a535..7f573aef3c3 100644 --- a/src/gallium/drivers/softpipe/sp_prim_vbuf.c +++ b/src/gallium/drivers/softpipe/sp_prim_vbuf.c @@ -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 */ } diff --git a/src/gallium/drivers/softpipe/sp_quad_blend.c b/src/gallium/drivers/softpipe/sp_quad_blend.c index fe6b6cec353..d9babe81dad 100644 --- a/src/gallium/drivers/softpipe/sp_quad_blend.c +++ b/src/gallium/drivers/softpipe/sp_quad_blend.c @@ -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 diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c index 80f4874b780..ad47a56fba4 100644 --- a/src/gallium/drivers/trace/tr_context.c +++ b/src/gallium/drivers/trace/tr_context.c @@ -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; } diff --git a/src/gallium/drivers/trace/tr_dump.c b/src/gallium/drivers/trace/tr_dump.c index 7e2ccbcfdc5..0f45e211a32 100644 --- a/src/gallium/drivers/trace/tr_dump.c +++ b/src/gallium/drivers/trace/tr_dump.c @@ -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); diff --git a/src/gallium/drivers/trace/tr_rbug.c b/src/gallium/drivers/trace/tr_rbug.c index c31b1d86986..0546aad9b50 100644 --- a/src/gallium/drivers/trace/tr_rbug.c +++ b/src/gallium/drivers/trace/tr_rbug.c @@ -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; diff --git a/src/gallium/state_trackers/egl/egl_surface.c b/src/gallium/state_trackers/egl/egl_surface.c index 0b60b5be059..d55aa51b82d 100644 --- a/src/gallium/state_trackers/egl/egl_surface.c +++ b/src/gallium/state_trackers/egl/egl_surface.c @@ -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); diff --git a/src/gallium/state_trackers/egl/egl_tracker.c b/src/gallium/state_trackers/egl/egl_tracker.c index 745803c7eb0..9345b0f4908 100644 --- a/src/gallium/state_trackers/egl/egl_tracker.c +++ b/src/gallium/state_trackers/egl/egl_tracker.c @@ -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); diff --git a/src/gallium/state_trackers/glx/xlib/glx_api.c b/src/gallium/state_trackers/glx/xlib/glx_api.c index f2881b9a31e..228ac9a20e9 100644 --- a/src/gallium/state_trackers/glx/xlib/glx_api.c +++ b/src/gallium/state_trackers/glx/xlib/glx_api.c @@ -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; } diff --git a/src/gallium/state_trackers/vega/api_path.c b/src/gallium/state_trackers/vega/api_path.c index a6b7a2bb93a..15ac1900f4b 100644 --- a/src/gallium/state_trackers/vega/api_path.c +++ b/src/gallium/state_trackers/vega/api_path.c @@ -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; } diff --git a/src/gallium/state_trackers/vega/arc.c b/src/gallium/state_trackers/vega/arc.c index 8b04d21ea76..2d123408702 100644 --- a/src/gallium/state_trackers/vega/arc.c +++ b/src/gallium/state_trackers/vega/arc.c @@ -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; diff --git a/src/gallium/state_trackers/vega/bezier.c b/src/gallium/state_trackers/vega/bezier.c index 0d5504004cc..5769e8ea868 100644 --- a/src/gallium/state_trackers/vega/bezier.c +++ b/src/gallium/state_trackers/vega/bezier.c @@ -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]; diff --git a/src/gallium/state_trackers/vega/stroker.c b/src/gallium/state_trackers/vega/stroker.c index 1b92d2b5c62..68a52029db0 100644 --- a/src/gallium/state_trackers/vega/stroker.c +++ b/src/gallium/state_trackers/vega/stroker.c @@ -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) { diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c index c776faa53f8..e390ce29aea 100644 --- a/src/gallium/state_trackers/xorg/xorg_crtc.c +++ b/src/gallium/state_trackers/xorg/xorg_crtc.c @@ -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; */ } /* diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index 8a24aa10a3c..4d169a1d14c 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -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; diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index d5c005ebadd..aa68570b9c0 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -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); diff --git a/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c b/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c index 89b794a09ac..bed17caab77 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c +++ b/src/gallium/state_trackers/xorg/xorg_exa_tgsi.c @@ -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, diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.c b/src/gallium/state_trackers/xorg/xorg_renderer.c index ba15f8a7845..d80f341e6c2 100644 --- a/src/gallium/state_trackers/xorg/xorg_renderer.c +++ b/src/gallium/state_trackers/xorg/xorg_renderer.c @@ -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 */ diff --git a/src/gallium/winsys/xlib/xlib_brw_context.c b/src/gallium/winsys/xlib/xlib_brw_context.c new file mode 100644 index 00000000000..fc9addd09e3 --- /dev/null +++ b/src/gallium/winsys/xlib/xlib_brw_context.c @@ -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 +} diff --git a/src/glu/sgi/libnurbs/internals/arcsorter.h b/src/glu/sgi/libnurbs/internals/arcsorter.h index d72dd1e86ce..a55df926772 100644 --- a/src/glu/sgi/libnurbs/internals/arcsorter.h +++ b/src/glu/sgi/libnurbs/internals/arcsorter.h @@ -37,7 +37,6 @@ #define __gluarcsorter_h_ #include "sorter.h" -#include "arcsorter.h" class Arc; class Subdivider; diff --git a/src/glu/sgi/libnurbs/internals/gridvertex.h b/src/glu/sgi/libnurbs/internals/gridvertex.h index 36a65c7bdd3..2e27436ef81 100644 --- a/src/glu/sgi/libnurbs/internals/gridvertex.h +++ b/src/glu/sgi/libnurbs/internals/gridvertex.h @@ -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]++; } diff --git a/src/glu/sgi/libnurbs/internals/reader.h b/src/glu/sgi/libnurbs/internals/reader.h index 8a8dcebb501..3f259c777b5 100644 --- a/src/glu/sgi/libnurbs/internals/reader.h +++ b/src/glu/sgi/libnurbs/internals/reader.h @@ -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 { diff --git a/src/glu/sgi/libnurbs/internals/subdivider.cc b/src/glu/sgi/libnurbs/internals/subdivider.cc index cc0b5147065..ccddc270ff9 100644 --- a/src/glu/sgi/libnurbs/internals/subdivider.cc +++ b/src/glu/sgi/libnurbs/internals/subdivider.cc @@ -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 diff --git a/src/glu/sgi/libnurbs/internals/varray.cc b/src/glu/sgi/libnurbs/internals/varray.cc index 31cc73a9d08..1cb235443ad 100644 --- a/src/glu/sgi/libnurbs/internals/varray.cc +++ b/src/glu/sgi/libnurbs/internals/varray.cc @@ -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 ) diff --git a/src/glu/sgi/libnurbs/nurbtess/directedLine.cc b/src/glu/sgi/libnurbs/nurbtess/directedLine.cc index 74450352d8c..d942db7287e 100644 --- a/src/glu/sgi/libnurbs/nurbtess/directedLine.cc +++ b/src/glu/sgi/libnurbs/nurbtess/directedLine.cc @@ -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); diff --git a/src/glu/sgi/libnurbs/nurbtess/monoChain.cc b/src/glu/sgi/libnurbs/nurbtess/monoChain.cc index 814bf32fae0..b17b9405c1a 100644 --- a/src/glu/sgi/libnurbs/nurbtess/monoChain.cc +++ b/src/glu/sgi/libnurbs/nurbtess/monoChain.cc @@ -127,6 +127,7 @@ monoChain::monoChain(directedLine* cHead, directedLine* cTail) current = chainTail; isKey = 0; + keyY = 0; } //insert a new line between prev and this diff --git a/src/glu/sgi/libnurbs/nurbtess/partitionY.cc b/src/glu/sgi/libnurbs/nurbtess/partitionY.cc index 297c6299766..e097461ac5e 100644 --- a/src/glu/sgi/libnurbs/nurbtess/partitionY.cc +++ b/src/glu/sgi/libnurbs/nurbtess/partitionY.cc @@ -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; diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc b/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc index e12f88bab12..2e70f839363 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc +++ b/src/glu/sgi/libnurbs/nurbtess/sampleCompBot.cc @@ -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, diff --git a/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc b/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc index b7b929623a2..951e937c45f 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc +++ b/src/glu/sgi/libnurbs/nurbtess/sampleCompTop.cc @@ -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) { diff --git a/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc b/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc index 6253a7c09d3..89f6c6e23fe 100644 --- a/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc +++ b/src/glu/sgi/libnurbs/nurbtess/sampledLine.cc @@ -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!!! diff --git a/src/glx/x11/dri2.c b/src/glx/x11/dri2.c index e144ed3e1f9..dad04470a00 100644 --- a/src/glx/x11/dri2.c +++ b/src/glx/x11/dri2.c @@ -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 */ diff --git a/src/glx/x11/glxext.c b/src/glx/x11/glxext.c index e5553cbf76c..5633a3e4a29 100644 --- a/src/glx/x11/glxext.c +++ b/src/glx/x11/glxext.c @@ -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; } diff --git a/src/glx/x11/xf86dri.h b/src/glx/x11/xf86dri.h index f2d0dd54355..ba266003f70 100644 --- a/src/glx/x11/xf86dri.h +++ b/src/glx/x11/xf86dri.h @@ -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_ */ diff --git a/src/mesa/drivers/dri/ffb/ffb_tris.c b/src/mesa/drivers/dri/ffb/ffb_tris.c index d785c157181..e7dd960ba16 100644 --- a/src/mesa/drivers/dri/ffb/ffb_tris.c +++ b/src/mesa/drivers/dri/ffb/ffb_tris.c @@ -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; /*********************************************************************** diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c index e7908bd48fc..3902c690970 100644 --- a/src/mesa/drivers/dri/i915/i915_program.c +++ b/src/mesa/drivers/dri/i915/i915_program.c @@ -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. */ diff --git a/src/mesa/drivers/dri/i915/intel_render.c b/src/mesa/drivers/dri/i915/intel_render.c index 410052b3c2b..ec209391ab4 100644 --- a/src/mesa/drivers/dri/i915/intel_render.c +++ b/src/mesa/drivers/dri/i915/intel_render.c @@ -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) diff --git a/src/mesa/drivers/dri/i965/brw_disasm.c b/src/mesa/drivers/dri/i965/brw_disasm.c index 47629dfa3d6..a8f6b993ac3 100644 --- a/src/mesa/drivers/dri/i965/brw_disasm.c +++ b/src/mesa/drivers/dri/i965/brw_disasm.c @@ -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; } diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index 3413c969281..8d6ac008396 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -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); } diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index b129b1f1c3f..14d5319796a 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -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)); diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 7811689d6ad..cc1052f757c 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -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); } diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index eccbfd5fa3a..fde83eea620 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -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); } diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index e85886db82f..09e8223bc7e 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -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) { diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index d0bcc2a3602..f23f94f35e4 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -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) diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index 767d04d2f4b..ee953cfbe78 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -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, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index 0aa09e733be..e31ae97b023 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -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", diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 329b7950745..5983f00e2dd 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -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; } } diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index bd7cc8d2780..d786c41d2eb 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -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); diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index d4f84294884..a1e69b84509 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -145,6 +145,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); @@ -185,7 +188,7 @@ static struct asm_instruction *asm_instruction_copy_ctor( /* Line 189 of yacc.c */ -#line 189 "program_parse.tab.c" +#line 192 "program_parse.tab.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -327,7 +330,7 @@ typedef union YYSTYPE { /* Line 214 of yacc.c */ -#line 122 "program_parse.y" +#line 125 "program_parse.y" struct asm_instruction *inst; struct asm_symbol *sym; @@ -356,7 +359,7 @@ typedef union YYSTYPE /* Line 214 of yacc.c */ -#line 360 "program_parse.tab.c" +#line 363 "program_parse.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -380,14 +383,14 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ -#line 267 "program_parse.y" +#line 270 "program_parse.y" extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner); /* Line 264 of yacc.c */ -#line 391 "program_parse.tab.c" +#line 394 "program_parse.tab.c" #ifdef short # undef short @@ -788,35 +791,35 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 274, 274, 277, 285, 297, 298, 301, 325, 326, - 329, 344, 347, 352, 359, 360, 361, 362, 363, 364, - 365, 368, 369, 370, 373, 379, 385, 391, 398, 404, - 411, 455, 460, 470, 514, 520, 521, 522, 523, 524, - 525, 526, 527, 528, 529, 530, 531, 534, 546, 554, - 571, 578, 595, 606, 626, 651, 658, 691, 698, 713, - 768, 809, 818, 839, 848, 852, 881, 900, 900, 902, - 909, 921, 922, 923, 926, 940, 954, 974, 985, 997, - 999, 1000, 1001, 1002, 1005, 1005, 1005, 1005, 1006, 1009, - 1013, 1018, 1025, 1032, 1039, 1062, 1085, 1086, 1087, 1088, - 1089, 1090, 1093, 1112, 1116, 1122, 1126, 1130, 1134, 1143, - 1152, 1156, 1161, 1167, 1178, 1178, 1179, 1181, 1185, 1189, - 1193, 1199, 1199, 1201, 1218, 1243, 1246, 1257, 1263, 1269, - 1270, 1277, 1283, 1289, 1297, 1303, 1309, 1317, 1323, 1329, - 1337, 1338, 1341, 1342, 1343, 1344, 1345, 1346, 1347, 1348, - 1349, 1350, 1351, 1354, 1363, 1367, 1371, 1377, 1386, 1390, - 1394, 1403, 1407, 1413, 1419, 1426, 1431, 1439, 1449, 1451, - 1459, 1465, 1469, 1473, 1479, 1490, 1499, 1503, 1508, 1512, - 1516, 1520, 1526, 1533, 1537, 1543, 1551, 1562, 1569, 1573, - 1579, 1589, 1600, 1604, 1622, 1631, 1634, 1640, 1644, 1648, - 1654, 1665, 1670, 1675, 1680, 1685, 1690, 1698, 1701, 1706, - 1719, 1727, 1738, 1746, 1746, 1748, 1748, 1750, 1760, 1765, - 1772, 1782, 1791, 1796, 1803, 1813, 1823, 1835, 1835, 1836, - 1836, 1838, 1848, 1856, 1866, 1874, 1882, 1891, 1902, 1906, - 1912, 1913, 1914, 1917, 1917, 1920, 1955, 1959, 1959, 1962, - 1969, 1978, 1992, 2001, 2010, 2014, 2023, 2032, 2043, 2050, - 2055, 2064, 2076, 2079, 2088, 2099, 2100, 2101, 2104, 2105, - 2106, 2109, 2110, 2113, 2114, 2117, 2118, 2121, 2132, 2143, - 2154, 2180, 2181 + 0, 277, 277, 280, 288, 300, 301, 304, 328, 329, + 332, 347, 350, 355, 362, 363, 364, 365, 366, 367, + 368, 371, 372, 373, 376, 382, 388, 394, 401, 407, + 414, 458, 463, 473, 517, 523, 524, 525, 526, 527, + 528, 529, 530, 531, 532, 533, 534, 537, 549, 557, + 574, 581, 600, 611, 631, 656, 663, 696, 703, 718, + 773, 816, 825, 846, 856, 860, 889, 908, 908, 910, + 917, 929, 930, 931, 934, 948, 962, 982, 993, 1005, + 1007, 1008, 1009, 1010, 1013, 1013, 1013, 1013, 1014, 1017, + 1021, 1026, 1033, 1040, 1047, 1070, 1093, 1094, 1095, 1096, + 1097, 1098, 1101, 1120, 1124, 1130, 1134, 1138, 1142, 1151, + 1160, 1164, 1169, 1175, 1186, 1186, 1187, 1189, 1193, 1197, + 1201, 1207, 1207, 1209, 1227, 1253, 1256, 1267, 1273, 1279, + 1280, 1287, 1293, 1299, 1307, 1313, 1319, 1327, 1333, 1339, + 1347, 1348, 1351, 1352, 1353, 1354, 1355, 1356, 1357, 1358, + 1359, 1360, 1361, 1364, 1373, 1377, 1381, 1387, 1396, 1400, + 1404, 1413, 1417, 1423, 1429, 1436, 1441, 1449, 1459, 1461, + 1469, 1475, 1479, 1483, 1489, 1500, 1509, 1513, 1518, 1522, + 1526, 1530, 1536, 1543, 1547, 1553, 1561, 1572, 1579, 1583, + 1589, 1599, 1610, 1614, 1632, 1641, 1644, 1650, 1654, 1658, + 1664, 1675, 1680, 1685, 1690, 1695, 1700, 1708, 1711, 1716, + 1729, 1737, 1748, 1756, 1756, 1758, 1758, 1760, 1770, 1775, + 1782, 1792, 1801, 1806, 1813, 1823, 1833, 1845, 1845, 1846, + 1846, 1848, 1858, 1866, 1876, 1884, 1892, 1901, 1912, 1916, + 1922, 1923, 1924, 1927, 1927, 1930, 1965, 1969, 1969, 1972, + 1979, 1988, 2002, 2011, 2020, 2024, 2033, 2042, 2053, 2060, + 2065, 2074, 2086, 2089, 2098, 2109, 2110, 2111, 2114, 2115, + 2116, 2119, 2120, 2123, 2124, 2127, 2128, 2131, 2142, 2153, + 2164, 2190, 2191 }; #endif @@ -2125,7 +2128,7 @@ yyreduce: case 3: /* Line 1455 of yacc.c */ -#line 278 "program_parse.y" +#line 281 "program_parse.y" { if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid fragment program header"); @@ -2138,7 +2141,7 @@ yyreduce: case 4: /* Line 1455 of yacc.c */ -#line 286 "program_parse.y" +#line 289 "program_parse.y" { if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex program header"); @@ -2153,7 +2156,7 @@ yyreduce: case 7: /* Line 1455 of yacc.c */ -#line 302 "program_parse.y" +#line 305 "program_parse.y" { int valid = 0; @@ -2180,7 +2183,7 @@ yyreduce: case 10: /* Line 1455 of yacc.c */ -#line 330 "program_parse.y" +#line 333 "program_parse.y" { if ((yyvsp[(1) - (2)].inst) != NULL) { if (state->inst_tail == NULL) { @@ -2200,7 +2203,7 @@ yyreduce: case 12: /* Line 1455 of yacc.c */ -#line 348 "program_parse.y" +#line 351 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumAluInstructions++; @@ -2210,7 +2213,7 @@ yyreduce: case 13: /* Line 1455 of yacc.c */ -#line 353 "program_parse.y" +#line 356 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumTexInstructions++; @@ -2220,7 +2223,7 @@ yyreduce: case 24: /* Line 1455 of yacc.c */ -#line 374 "program_parse.y" +#line 377 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2229,7 +2232,7 @@ yyreduce: case 25: /* Line 1455 of yacc.c */ -#line 380 "program_parse.y" +#line 383 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2238,7 +2241,7 @@ yyreduce: case 26: /* Line 1455 of yacc.c */ -#line 386 "program_parse.y" +#line 389 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2247,7 +2250,7 @@ yyreduce: case 27: /* Line 1455 of yacc.c */ -#line 392 "program_parse.y" +#line 395 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); ;} @@ -2256,7 +2259,7 @@ yyreduce: case 28: /* Line 1455 of yacc.c */ -#line 399 "program_parse.y" +#line 402 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); ;} @@ -2265,7 +2268,7 @@ yyreduce: case 29: /* Line 1455 of yacc.c */ -#line 406 "program_parse.y" +#line 409 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); ;} @@ -2274,7 +2277,7 @@ yyreduce: case 30: /* Line 1455 of yacc.c */ -#line 412 "program_parse.y" +#line 415 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); if ((yyval.inst) != NULL) { @@ -2321,7 +2324,7 @@ yyreduce: case 31: /* Line 1455 of yacc.c */ -#line 456 "program_parse.y" +#line 459 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); state->fragment.UsesKill = 1; @@ -2331,7 +2334,7 @@ yyreduce: case 32: /* Line 1455 of yacc.c */ -#line 461 "program_parse.y" +#line 464 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL_NV, NULL, NULL, NULL, NULL); (yyval.inst)->Base.DstReg.CondMask = (yyvsp[(2) - (2)].dst_reg).CondMask; @@ -2344,7 +2347,7 @@ yyreduce: case 33: /* Line 1455 of yacc.c */ -#line 471 "program_parse.y" +#line 474 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (12)].temp_inst), & (yyvsp[(2) - (12)].dst_reg), & (yyvsp[(4) - (12)].src_reg), & (yyvsp[(6) - (12)].src_reg), & (yyvsp[(8) - (12)].src_reg)); if ((yyval.inst) != NULL) { @@ -2391,7 +2394,7 @@ yyreduce: case 34: /* Line 1455 of yacc.c */ -#line 515 "program_parse.y" +#line 518 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -2400,91 +2403,91 @@ yyreduce: case 35: /* Line 1455 of yacc.c */ -#line 520 "program_parse.y" +#line 523 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; case 36: /* Line 1455 of yacc.c */ -#line 521 "program_parse.y" +#line 524 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; case 37: /* Line 1455 of yacc.c */ -#line 522 "program_parse.y" +#line 525 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; case 38: /* Line 1455 of yacc.c */ -#line 523 "program_parse.y" +#line 526 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; case 39: /* Line 1455 of yacc.c */ -#line 524 "program_parse.y" +#line 527 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; case 40: /* Line 1455 of yacc.c */ -#line 525 "program_parse.y" +#line 528 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_INDEX; ;} break; case 41: /* Line 1455 of yacc.c */ -#line 526 "program_parse.y" +#line 529 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_INDEX; ;} break; case 42: /* Line 1455 of yacc.c */ -#line 527 "program_parse.y" +#line 530 "program_parse.y" { (yyval.integer) = -TEXTURE_RECT_INDEX; ;} break; case 43: /* Line 1455 of yacc.c */ -#line 528 "program_parse.y" +#line 531 "program_parse.y" { (yyval.integer) = TEXTURE_1D_ARRAY_INDEX; ;} break; case 44: /* Line 1455 of yacc.c */ -#line 529 "program_parse.y" +#line 532 "program_parse.y" { (yyval.integer) = TEXTURE_2D_ARRAY_INDEX; ;} break; case 45: /* Line 1455 of yacc.c */ -#line 530 "program_parse.y" +#line 533 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_ARRAY_INDEX; ;} break; case 46: /* Line 1455 of yacc.c */ -#line 531 "program_parse.y" +#line 534 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_ARRAY_INDEX; ;} break; case 47: /* Line 1455 of yacc.c */ -#line 535 "program_parse.y" +#line 538 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@ -2499,7 +2502,7 @@ yyreduce: case 48: /* Line 1455 of yacc.c */ -#line 547 "program_parse.y" +#line 550 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (2)].src_reg); @@ -2512,7 +2515,7 @@ yyreduce: case 49: /* Line 1455 of yacc.c */ -#line 555 "program_parse.y" +#line 558 "program_parse.y" { (yyval.src_reg) = (yyvsp[(3) - (4)].src_reg); @@ -2532,7 +2535,7 @@ yyreduce: case 50: /* Line 1455 of yacc.c */ -#line 572 "program_parse.y" +#line 575 "program_parse.y" { (yyval.src_reg) = (yyvsp[(1) - (2)].src_reg); @@ -2544,7 +2547,7 @@ yyreduce: case 51: /* Line 1455 of yacc.c */ -#line 579 "program_parse.y" +#line 582 "program_parse.y" { struct asm_symbol temp_sym; @@ -2557,14 +2560,16 @@ yyreduce: temp_sym.param_binding_begin = ~0; initialize_symbol_from_const(state->prog, & temp_sym, & (yyvsp[(1) - (1)].vector)); - set_src_reg(& (yyval.src_reg), PROGRAM_CONSTANT, temp_sym.param_binding_begin); + set_src_reg_swz(& (yyval.src_reg), PROGRAM_CONSTANT, + temp_sym.param_binding_begin, + temp_sym.param_binding_swizzle); ;} break; case 52: /* Line 1455 of yacc.c */ -#line 596 "program_parse.y" +#line 601 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2580,7 +2585,7 @@ yyreduce: case 53: /* Line 1455 of yacc.c */ -#line 607 "program_parse.y" +#line 612 "program_parse.y" { (yyval.src_reg) = (yyvsp[(3) - (5)].src_reg); @@ -2602,7 +2607,7 @@ yyreduce: case 54: /* Line 1455 of yacc.c */ -#line 627 "program_parse.y" +#line 632 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (3)].dst_reg); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (3)].swiz_mask).mask; @@ -2630,7 +2635,7 @@ yyreduce: case 55: /* Line 1455 of yacc.c */ -#line 652 "program_parse.y" +#line 657 "program_parse.y" { set_dst_reg(& (yyval.dst_reg), PROGRAM_ADDRESS, 0); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; @@ -2640,7 +2645,7 @@ yyreduce: case 56: /* Line 1455 of yacc.c */ -#line 659 "program_parse.y" +#line 664 "program_parse.y" { const unsigned xyzw_valid = ((yyvsp[(1) - (7)].ext_swizzle).xyzw_valid << 0) @@ -2676,7 +2681,7 @@ yyreduce: case 57: /* Line 1455 of yacc.c */ -#line 692 "program_parse.y" +#line 697 "program_parse.y" { (yyval.ext_swizzle) = (yyvsp[(2) - (2)].ext_swizzle); (yyval.ext_swizzle).negate = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; @@ -2686,7 +2691,7 @@ yyreduce: case 58: /* Line 1455 of yacc.c */ -#line 699 "program_parse.y" +#line 704 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2706,7 +2711,7 @@ yyreduce: case 59: /* Line 1455 of yacc.c */ -#line 714 "program_parse.y" +#line 719 "program_parse.y" { char s; @@ -2764,7 +2769,7 @@ yyreduce: case 60: /* Line 1455 of yacc.c */ -#line 769 "program_parse.y" +#line 774 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2789,7 +2794,9 @@ yyreduce: set_src_reg(& (yyval.src_reg), PROGRAM_TEMPORARY, s->temp_binding); break; case at_param: - set_src_reg(& (yyval.src_reg), s->param_binding_type, s->param_binding_begin); + set_src_reg_swz(& (yyval.src_reg), s->param_binding_type, + s->param_binding_begin, + s->param_binding_swizzle); break; case at_attrib: set_src_reg(& (yyval.src_reg), PROGRAM_INPUT, s->attrib_binding); @@ -2810,7 +2817,7 @@ yyreduce: case 61: /* Line 1455 of yacc.c */ -#line 810 "program_parse.y" +#line 817 "program_parse.y" { set_src_reg(& (yyval.src_reg), PROGRAM_INPUT, (yyvsp[(1) - (1)].attrib)); state->prog->InputsRead |= (1U << (yyval.src_reg).Base.Index); @@ -2824,7 +2831,7 @@ yyreduce: case 62: /* Line 1455 of yacc.c */ -#line 819 "program_parse.y" +#line 826 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2850,19 +2857,20 @@ yyreduce: case 63: /* Line 1455 of yacc.c */ -#line 840 "program_parse.y" +#line 847 "program_parse.y" { gl_register_file file = ((yyvsp[(1) - (1)].temp_sym).name != NULL) ? (yyvsp[(1) - (1)].temp_sym).param_binding_type : PROGRAM_CONSTANT; - set_src_reg(& (yyval.src_reg), file, (yyvsp[(1) - (1)].temp_sym).param_binding_begin); + set_src_reg_swz(& (yyval.src_reg), file, (yyvsp[(1) - (1)].temp_sym).param_binding_begin, + (yyvsp[(1) - (1)].temp_sym).param_binding_swizzle); ;} break; case 64: /* Line 1455 of yacc.c */ -#line 849 "program_parse.y" +#line 857 "program_parse.y" { set_dst_reg(& (yyval.dst_reg), PROGRAM_OUTPUT, (yyvsp[(1) - (1)].result)); ;} @@ -2871,7 +2879,7 @@ yyreduce: case 65: /* Line 1455 of yacc.c */ -#line 853 "program_parse.y" +#line 861 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2903,7 +2911,7 @@ yyreduce: case 66: /* Line 1455 of yacc.c */ -#line 882 "program_parse.y" +#line 890 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2925,7 +2933,7 @@ yyreduce: case 69: /* Line 1455 of yacc.c */ -#line 903 "program_parse.y" +#line 911 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); @@ -2935,7 +2943,7 @@ yyreduce: case 70: /* Line 1455 of yacc.c */ -#line 910 "program_parse.y" +#line 918 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2950,28 +2958,28 @@ yyreduce: case 71: /* Line 1455 of yacc.c */ -#line 921 "program_parse.y" +#line 929 "program_parse.y" { (yyval.integer) = 0; ;} break; case 72: /* Line 1455 of yacc.c */ -#line 922 "program_parse.y" +#line 930 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 73: /* Line 1455 of yacc.c */ -#line 923 "program_parse.y" +#line 931 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; case 74: /* Line 1455 of yacc.c */ -#line 927 "program_parse.y" +#line 935 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { char s[100]; @@ -2988,7 +2996,7 @@ yyreduce: case 75: /* Line 1455 of yacc.c */ -#line 941 "program_parse.y" +#line 949 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { char s[100]; @@ -3005,7 +3013,7 @@ yyreduce: case 76: /* Line 1455 of yacc.c */ -#line 955 "program_parse.y" +#line 963 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -3028,7 +3036,7 @@ yyreduce: case 77: /* Line 1455 of yacc.c */ -#line 975 "program_parse.y" +#line 983 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -3042,7 +3050,7 @@ yyreduce: case 78: /* Line 1455 of yacc.c */ -#line 986 "program_parse.y" +#line 994 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -3057,21 +3065,21 @@ yyreduce: case 83: /* Line 1455 of yacc.c */ -#line 1002 "program_parse.y" +#line 1010 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 88: /* Line 1455 of yacc.c */ -#line 1006 "program_parse.y" +#line 1014 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 89: /* Line 1455 of yacc.c */ -#line 1010 "program_parse.y" +#line 1018 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(2) - (3)].dst_reg); ;} @@ -3080,7 +3088,7 @@ yyreduce: case 90: /* Line 1455 of yacc.c */ -#line 1014 "program_parse.y" +#line 1022 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(2) - (3)].dst_reg); ;} @@ -3089,7 +3097,7 @@ yyreduce: case 91: /* Line 1455 of yacc.c */ -#line 1018 "program_parse.y" +#line 1026 "program_parse.y" { (yyval.dst_reg).CondMask = COND_TR; (yyval.dst_reg).CondSwizzle = SWIZZLE_NOOP; @@ -3100,7 +3108,7 @@ yyreduce: case 92: /* Line 1455 of yacc.c */ -#line 1026 "program_parse.y" +#line 1034 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).CondSwizzle = (yyvsp[(2) - (2)].swiz_mask).swizzle; @@ -3110,7 +3118,7 @@ yyreduce: case 93: /* Line 1455 of yacc.c */ -#line 1033 "program_parse.y" +#line 1041 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).CondSwizzle = (yyvsp[(2) - (2)].swiz_mask).swizzle; @@ -3120,7 +3128,7 @@ yyreduce: case 94: /* Line 1455 of yacc.c */ -#line 1040 "program_parse.y" +#line 1048 "program_parse.y" { const int cond = _mesa_parse_cc((yyvsp[(1) - (1)].string)); if ((cond == 0) || ((yyvsp[(1) - (1)].string)[2] != '\0')) { @@ -3146,7 +3154,7 @@ yyreduce: case 95: /* Line 1455 of yacc.c */ -#line 1063 "program_parse.y" +#line 1071 "program_parse.y" { const int cond = _mesa_parse_cc((yyvsp[(1) - (1)].string)); if ((cond == 0) || ((yyvsp[(1) - (1)].string)[2] != '\0')) { @@ -3172,7 +3180,7 @@ yyreduce: case 102: /* Line 1455 of yacc.c */ -#line 1094 "program_parse.y" +#line 1102 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -3194,7 +3202,7 @@ yyreduce: case 103: /* Line 1455 of yacc.c */ -#line 1113 "program_parse.y" +#line 1121 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -3203,7 +3211,7 @@ yyreduce: case 104: /* Line 1455 of yacc.c */ -#line 1117 "program_parse.y" +#line 1125 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -3212,7 +3220,7 @@ yyreduce: case 105: /* Line 1455 of yacc.c */ -#line 1123 "program_parse.y" +#line 1131 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} @@ -3221,7 +3229,7 @@ yyreduce: case 106: /* Line 1455 of yacc.c */ -#line 1127 "program_parse.y" +#line 1135 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} @@ -3230,7 +3238,7 @@ yyreduce: case 107: /* Line 1455 of yacc.c */ -#line 1131 "program_parse.y" +#line 1139 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} @@ -3239,7 +3247,7 @@ yyreduce: case 108: /* Line 1455 of yacc.c */ -#line 1135 "program_parse.y" +#line 1143 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@ -3253,7 +3261,7 @@ yyreduce: case 109: /* Line 1455 of yacc.c */ -#line 1144 "program_parse.y" +#line 1152 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@ -3267,7 +3275,7 @@ yyreduce: case 110: /* Line 1455 of yacc.c */ -#line 1153 "program_parse.y" +#line 1161 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -3276,7 +3284,7 @@ yyreduce: case 111: /* Line 1455 of yacc.c */ -#line 1157 "program_parse.y" +#line 1165 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -3286,7 +3294,7 @@ yyreduce: case 112: /* Line 1455 of yacc.c */ -#line 1162 "program_parse.y" +#line 1170 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} @@ -3295,7 +3303,7 @@ yyreduce: case 113: /* Line 1455 of yacc.c */ -#line 1168 "program_parse.y" +#line 1176 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -3309,7 +3317,7 @@ yyreduce: case 117: /* Line 1455 of yacc.c */ -#line 1182 "program_parse.y" +#line 1190 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} @@ -3318,7 +3326,7 @@ yyreduce: case 118: /* Line 1455 of yacc.c */ -#line 1186 "program_parse.y" +#line 1194 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} @@ -3327,7 +3335,7 @@ yyreduce: case 119: /* Line 1455 of yacc.c */ -#line 1190 "program_parse.y" +#line 1198 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} @@ -3336,7 +3344,7 @@ yyreduce: case 120: /* Line 1455 of yacc.c */ -#line 1194 "program_parse.y" +#line 1202 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -3345,7 +3353,7 @@ yyreduce: case 123: /* Line 1455 of yacc.c */ -#line 1202 "program_parse.y" +#line 1210 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -3357,6 +3365,7 @@ yyreduce: s->param_binding_type = (yyvsp[(3) - (3)].temp_sym).param_binding_type; s->param_binding_begin = (yyvsp[(3) - (3)].temp_sym).param_binding_begin; s->param_binding_length = (yyvsp[(3) - (3)].temp_sym).param_binding_length; + s->param_binding_swizzle = SWIZZLE_XYZW; s->param_is_array = 0; } ;} @@ -3365,7 +3374,7 @@ yyreduce: case 124: /* Line 1455 of yacc.c */ -#line 1219 "program_parse.y" +#line 1228 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { free((yyvsp[(2) - (6)].string)); @@ -3383,6 +3392,7 @@ yyreduce: s->param_binding_type = (yyvsp[(6) - (6)].temp_sym).param_binding_type; s->param_binding_begin = (yyvsp[(6) - (6)].temp_sym).param_binding_begin; s->param_binding_length = (yyvsp[(6) - (6)].temp_sym).param_binding_length; + s->param_binding_swizzle = SWIZZLE_XYZW; s->param_is_array = 1; } } @@ -3392,7 +3402,7 @@ yyreduce: case 125: /* Line 1455 of yacc.c */ -#line 1243 "program_parse.y" +#line 1253 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3401,7 +3411,7 @@ yyreduce: case 126: /* Line 1455 of yacc.c */ -#line 1247 "program_parse.y" +#line 1257 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) > state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -3415,7 +3425,7 @@ yyreduce: case 127: /* Line 1455 of yacc.c */ -#line 1258 "program_parse.y" +#line 1268 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} @@ -3424,7 +3434,7 @@ yyreduce: case 128: /* Line 1455 of yacc.c */ -#line 1264 "program_parse.y" +#line 1274 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} @@ -3433,7 +3443,7 @@ yyreduce: case 130: /* Line 1455 of yacc.c */ -#line 1271 "program_parse.y" +#line 1281 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); @@ -3443,7 +3453,7 @@ yyreduce: case 131: /* Line 1455 of yacc.c */ -#line 1278 "program_parse.y" +#line 1288 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3454,7 +3464,7 @@ yyreduce: case 132: /* Line 1455 of yacc.c */ -#line 1284 "program_parse.y" +#line 1294 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3465,7 +3475,7 @@ yyreduce: case 133: /* Line 1455 of yacc.c */ -#line 1290 "program_parse.y" +#line 1300 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3476,7 +3486,7 @@ yyreduce: case 134: /* Line 1455 of yacc.c */ -#line 1298 "program_parse.y" +#line 1308 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3487,7 +3497,7 @@ yyreduce: case 135: /* Line 1455 of yacc.c */ -#line 1304 "program_parse.y" +#line 1314 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3498,7 +3508,7 @@ yyreduce: case 136: /* Line 1455 of yacc.c */ -#line 1310 "program_parse.y" +#line 1320 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3509,7 +3519,7 @@ yyreduce: case 137: /* Line 1455 of yacc.c */ -#line 1318 "program_parse.y" +#line 1328 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3520,7 +3530,7 @@ yyreduce: case 138: /* Line 1455 of yacc.c */ -#line 1324 "program_parse.y" +#line 1334 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3531,7 +3541,7 @@ yyreduce: case 139: /* Line 1455 of yacc.c */ -#line 1330 "program_parse.y" +#line 1340 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3542,98 +3552,98 @@ yyreduce: case 140: /* Line 1455 of yacc.c */ -#line 1337 "program_parse.y" +#line 1347 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; case 141: /* Line 1455 of yacc.c */ -#line 1338 "program_parse.y" +#line 1348 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 142: /* Line 1455 of yacc.c */ -#line 1341 "program_parse.y" +#line 1351 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 143: /* Line 1455 of yacc.c */ -#line 1342 "program_parse.y" +#line 1352 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 144: /* Line 1455 of yacc.c */ -#line 1343 "program_parse.y" +#line 1353 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 145: /* Line 1455 of yacc.c */ -#line 1344 "program_parse.y" +#line 1354 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 146: /* Line 1455 of yacc.c */ -#line 1345 "program_parse.y" +#line 1355 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 147: /* Line 1455 of yacc.c */ -#line 1346 "program_parse.y" +#line 1356 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 148: /* Line 1455 of yacc.c */ -#line 1347 "program_parse.y" +#line 1357 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 149: /* Line 1455 of yacc.c */ -#line 1348 "program_parse.y" +#line 1358 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 150: /* Line 1455 of yacc.c */ -#line 1349 "program_parse.y" +#line 1359 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 151: /* Line 1455 of yacc.c */ -#line 1350 "program_parse.y" +#line 1360 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 152: /* Line 1455 of yacc.c */ -#line 1351 "program_parse.y" +#line 1361 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 153: /* Line 1455 of yacc.c */ -#line 1355 "program_parse.y" +#line 1365 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3645,7 +3655,7 @@ yyreduce: case 154: /* Line 1455 of yacc.c */ -#line 1364 "program_parse.y" +#line 1374 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3654,7 +3664,7 @@ yyreduce: case 155: /* Line 1455 of yacc.c */ -#line 1368 "program_parse.y" +#line 1378 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} @@ -3663,7 +3673,7 @@ yyreduce: case 156: /* Line 1455 of yacc.c */ -#line 1372 "program_parse.y" +#line 1382 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} @@ -3672,7 +3682,7 @@ yyreduce: case 157: /* Line 1455 of yacc.c */ -#line 1378 "program_parse.y" +#line 1388 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3684,7 +3694,7 @@ yyreduce: case 158: /* Line 1455 of yacc.c */ -#line 1387 "program_parse.y" +#line 1397 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3693,7 +3703,7 @@ yyreduce: case 159: /* Line 1455 of yacc.c */ -#line 1391 "program_parse.y" +#line 1401 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} @@ -3702,7 +3712,7 @@ yyreduce: case 160: /* Line 1455 of yacc.c */ -#line 1395 "program_parse.y" +#line 1405 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3716,7 +3726,7 @@ yyreduce: case 161: /* Line 1455 of yacc.c */ -#line 1404 "program_parse.y" +#line 1414 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -3725,7 +3735,7 @@ yyreduce: case 162: /* Line 1455 of yacc.c */ -#line 1408 "program_parse.y" +#line 1418 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} @@ -3734,7 +3744,7 @@ yyreduce: case 163: /* Line 1455 of yacc.c */ -#line 1414 "program_parse.y" +#line 1424 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} @@ -3743,7 +3753,7 @@ yyreduce: case 164: /* Line 1455 of yacc.c */ -#line 1420 "program_parse.y" +#line 1430 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; @@ -3753,7 +3763,7 @@ yyreduce: case 165: /* Line 1455 of yacc.c */ -#line 1427 "program_parse.y" +#line 1437 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; @@ -3763,7 +3773,7 @@ yyreduce: case 166: /* Line 1455 of yacc.c */ -#line 1432 "program_parse.y" +#line 1442 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3774,7 +3784,7 @@ yyreduce: case 167: /* Line 1455 of yacc.c */ -#line 1440 "program_parse.y" +#line 1450 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3787,7 +3797,7 @@ yyreduce: case 169: /* Line 1455 of yacc.c */ -#line 1452 "program_parse.y" +#line 1462 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3798,7 +3808,7 @@ yyreduce: case 170: /* Line 1455 of yacc.c */ -#line 1460 "program_parse.y" +#line 1470 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} @@ -3807,7 +3817,7 @@ yyreduce: case 171: /* Line 1455 of yacc.c */ -#line 1466 "program_parse.y" +#line 1476 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} @@ -3816,7 +3826,7 @@ yyreduce: case 172: /* Line 1455 of yacc.c */ -#line 1470 "program_parse.y" +#line 1480 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} @@ -3825,7 +3835,7 @@ yyreduce: case 173: /* Line 1455 of yacc.c */ -#line 1474 "program_parse.y" +#line 1484 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} @@ -3834,7 +3844,7 @@ yyreduce: case 174: /* Line 1455 of yacc.c */ -#line 1480 "program_parse.y" +#line 1490 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3848,7 +3858,7 @@ yyreduce: case 175: /* Line 1455 of yacc.c */ -#line 1491 "program_parse.y" +#line 1501 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3860,7 +3870,7 @@ yyreduce: case 176: /* Line 1455 of yacc.c */ -#line 1500 "program_parse.y" +#line 1510 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} @@ -3869,7 +3879,7 @@ yyreduce: case 177: /* Line 1455 of yacc.c */ -#line 1504 "program_parse.y" +#line 1514 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} @@ -3878,7 +3888,7 @@ yyreduce: case 178: /* Line 1455 of yacc.c */ -#line 1509 "program_parse.y" +#line 1519 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} @@ -3887,7 +3897,7 @@ yyreduce: case 179: /* Line 1455 of yacc.c */ -#line 1513 "program_parse.y" +#line 1523 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} @@ -3896,7 +3906,7 @@ yyreduce: case 180: /* Line 1455 of yacc.c */ -#line 1517 "program_parse.y" +#line 1527 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} @@ -3905,7 +3915,7 @@ yyreduce: case 181: /* Line 1455 of yacc.c */ -#line 1521 "program_parse.y" +#line 1531 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} @@ -3914,7 +3924,7 @@ yyreduce: case 182: /* Line 1455 of yacc.c */ -#line 1527 "program_parse.y" +#line 1537 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3924,7 +3934,7 @@ yyreduce: case 183: /* Line 1455 of yacc.c */ -#line 1534 "program_parse.y" +#line 1544 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} @@ -3933,7 +3943,7 @@ yyreduce: case 184: /* Line 1455 of yacc.c */ -#line 1538 "program_parse.y" +#line 1548 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} @@ -3942,7 +3952,7 @@ yyreduce: case 185: /* Line 1455 of yacc.c */ -#line 1544 "program_parse.y" +#line 1554 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3953,7 +3963,7 @@ yyreduce: case 186: /* Line 1455 of yacc.c */ -#line 1552 "program_parse.y" +#line 1562 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3967,7 +3977,7 @@ yyreduce: case 187: /* Line 1455 of yacc.c */ -#line 1563 "program_parse.y" +#line 1573 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3977,7 +3987,7 @@ yyreduce: case 188: /* Line 1455 of yacc.c */ -#line 1570 "program_parse.y" +#line 1580 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} @@ -3986,7 +3996,7 @@ yyreduce: case 189: /* Line 1455 of yacc.c */ -#line 1574 "program_parse.y" +#line 1584 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} @@ -3995,7 +4005,7 @@ yyreduce: case 190: /* Line 1455 of yacc.c */ -#line 1580 "program_parse.y" +#line 1590 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -4008,7 +4018,7 @@ yyreduce: case 191: /* Line 1455 of yacc.c */ -#line 1590 "program_parse.y" +#line 1600 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -4021,7 +4031,7 @@ yyreduce: case 192: /* Line 1455 of yacc.c */ -#line 1600 "program_parse.y" +#line 1610 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; @@ -4031,7 +4041,7 @@ yyreduce: case 193: /* Line 1455 of yacc.c */ -#line 1605 "program_parse.y" +#line 1615 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -4052,7 +4062,7 @@ yyreduce: case 194: /* Line 1455 of yacc.c */ -#line 1623 "program_parse.y" +#line 1633 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -4063,7 +4073,7 @@ yyreduce: case 195: /* Line 1455 of yacc.c */ -#line 1631 "program_parse.y" +#line 1641 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4072,7 +4082,7 @@ yyreduce: case 196: /* Line 1455 of yacc.c */ -#line 1635 "program_parse.y" +#line 1645 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -4081,7 +4091,7 @@ yyreduce: case 197: /* Line 1455 of yacc.c */ -#line 1641 "program_parse.y" +#line 1651 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} @@ -4090,7 +4100,7 @@ yyreduce: case 198: /* Line 1455 of yacc.c */ -#line 1645 "program_parse.y" +#line 1655 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} @@ -4099,7 +4109,7 @@ yyreduce: case 199: /* Line 1455 of yacc.c */ -#line 1649 "program_parse.y" +#line 1659 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} @@ -4108,7 +4118,7 @@ yyreduce: case 200: /* Line 1455 of yacc.c */ -#line 1655 "program_parse.y" +#line 1665 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -4122,7 +4132,7 @@ yyreduce: case 201: /* Line 1455 of yacc.c */ -#line 1666 "program_parse.y" +#line 1676 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -4132,7 +4142,7 @@ yyreduce: case 202: /* Line 1455 of yacc.c */ -#line 1671 "program_parse.y" +#line 1681 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; @@ -4142,7 +4152,7 @@ yyreduce: case 203: /* Line 1455 of yacc.c */ -#line 1676 "program_parse.y" +#line 1686 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; @@ -4152,7 +4162,7 @@ yyreduce: case 204: /* Line 1455 of yacc.c */ -#line 1681 "program_parse.y" +#line 1691 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -4162,7 +4172,7 @@ yyreduce: case 205: /* Line 1455 of yacc.c */ -#line 1686 "program_parse.y" +#line 1696 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -4172,7 +4182,7 @@ yyreduce: case 206: /* Line 1455 of yacc.c */ -#line 1691 "program_parse.y" +#line 1701 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); @@ -4182,7 +4192,7 @@ yyreduce: case 207: /* Line 1455 of yacc.c */ -#line 1698 "program_parse.y" +#line 1708 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4191,7 +4201,7 @@ yyreduce: case 208: /* Line 1455 of yacc.c */ -#line 1702 "program_parse.y" +#line 1712 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} @@ -4200,7 +4210,7 @@ yyreduce: case 209: /* Line 1455 of yacc.c */ -#line 1707 "program_parse.y" +#line 1717 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -4217,7 +4227,7 @@ yyreduce: case 210: /* Line 1455 of yacc.c */ -#line 1720 "program_parse.y" +#line 1730 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -4229,7 +4239,7 @@ yyreduce: case 211: /* Line 1455 of yacc.c */ -#line 1728 "program_parse.y" +#line 1738 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -4243,7 +4253,7 @@ yyreduce: case 212: /* Line 1455 of yacc.c */ -#line 1739 "program_parse.y" +#line 1749 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_DEPTH_RANGE; @@ -4253,7 +4263,7 @@ yyreduce: case 217: /* Line 1455 of yacc.c */ -#line 1751 "program_parse.y" +#line 1761 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4266,7 +4276,7 @@ yyreduce: case 218: /* Line 1455 of yacc.c */ -#line 1761 "program_parse.y" +#line 1771 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -4276,7 +4286,7 @@ yyreduce: case 219: /* Line 1455 of yacc.c */ -#line 1766 "program_parse.y" +#line 1776 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -4286,7 +4296,7 @@ yyreduce: case 220: /* Line 1455 of yacc.c */ -#line 1773 "program_parse.y" +#line 1783 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4299,7 +4309,7 @@ yyreduce: case 221: /* Line 1455 of yacc.c */ -#line 1783 "program_parse.y" +#line 1793 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4312,7 +4322,7 @@ yyreduce: case 222: /* Line 1455 of yacc.c */ -#line 1792 "program_parse.y" +#line 1802 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -4322,7 +4332,7 @@ yyreduce: case 223: /* Line 1455 of yacc.c */ -#line 1797 "program_parse.y" +#line 1807 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -4332,7 +4342,7 @@ yyreduce: case 224: /* Line 1455 of yacc.c */ -#line 1804 "program_parse.y" +#line 1814 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4345,7 +4355,7 @@ yyreduce: case 225: /* Line 1455 of yacc.c */ -#line 1814 "program_parse.y" +#line 1824 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -4358,7 +4368,7 @@ yyreduce: case 226: /* Line 1455 of yacc.c */ -#line 1824 "program_parse.y" +#line 1834 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -4371,7 +4381,7 @@ yyreduce: case 231: /* Line 1455 of yacc.c */ -#line 1839 "program_parse.y" +#line 1849 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4384,7 +4394,7 @@ yyreduce: case 232: /* Line 1455 of yacc.c */ -#line 1849 "program_parse.y" +#line 1859 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4397,7 +4407,7 @@ yyreduce: case 233: /* Line 1455 of yacc.c */ -#line 1857 "program_parse.y" +#line 1867 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -4410,7 +4420,7 @@ yyreduce: case 234: /* Line 1455 of yacc.c */ -#line 1867 "program_parse.y" +#line 1877 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -4423,7 +4433,7 @@ yyreduce: case 235: /* Line 1455 of yacc.c */ -#line 1875 "program_parse.y" +#line 1885 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4436,7 +4446,7 @@ yyreduce: case 236: /* Line 1455 of yacc.c */ -#line 1884 "program_parse.y" +#line 1894 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4449,7 +4459,7 @@ yyreduce: case 237: /* Line 1455 of yacc.c */ -#line 1893 "program_parse.y" +#line 1903 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4462,7 +4472,7 @@ yyreduce: case 238: /* Line 1455 of yacc.c */ -#line 1903 "program_parse.y" +#line 1913 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} @@ -4471,7 +4481,7 @@ yyreduce: case 239: /* Line 1455 of yacc.c */ -#line 1907 "program_parse.y" +#line 1917 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} @@ -4480,35 +4490,35 @@ yyreduce: case 240: /* Line 1455 of yacc.c */ -#line 1912 "program_parse.y" +#line 1922 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 241: /* Line 1455 of yacc.c */ -#line 1913 "program_parse.y" +#line 1923 "program_parse.y" { (yyval.negate) = TRUE; ;} break; case 242: /* Line 1455 of yacc.c */ -#line 1914 "program_parse.y" +#line 1924 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 243: /* Line 1455 of yacc.c */ -#line 1917 "program_parse.y" +#line 1927 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 245: /* Line 1455 of yacc.c */ -#line 1921 "program_parse.y" +#line 1931 "program_parse.y" { /* NV_fragment_program_option defines the size qualifiers in a * fairly broken way. "SHORT" or "LONG" can optionally be used @@ -4547,7 +4557,7 @@ yyreduce: case 246: /* Line 1455 of yacc.c */ -#line 1955 "program_parse.y" +#line 1965 "program_parse.y" { ;} break; @@ -4555,14 +4565,14 @@ yyreduce: case 247: /* Line 1455 of yacc.c */ -#line 1959 "program_parse.y" +#line 1969 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 249: /* Line 1455 of yacc.c */ -#line 1963 "program_parse.y" +#line 1973 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { free((yyvsp[(3) - (3)].string)); @@ -4574,7 +4584,7 @@ yyreduce: case 250: /* Line 1455 of yacc.c */ -#line 1970 "program_parse.y" +#line 1980 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { free((yyvsp[(1) - (1)].string)); @@ -4586,7 +4596,7 @@ yyreduce: case 251: /* Line 1455 of yacc.c */ -#line 1979 "program_parse.y" +#line 1989 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(3) - (5)].string), at_output, & (yylsp[(3) - (5)])); @@ -4603,7 +4613,7 @@ yyreduce: case 252: /* Line 1455 of yacc.c */ -#line 1993 "program_parse.y" +#line 2003 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4617,7 +4627,7 @@ yyreduce: case 253: /* Line 1455 of yacc.c */ -#line 2002 "program_parse.y" +#line 2012 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4631,7 +4641,7 @@ yyreduce: case 254: /* Line 1455 of yacc.c */ -#line 2011 "program_parse.y" +#line 2021 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} @@ -4640,7 +4650,7 @@ yyreduce: case 255: /* Line 1455 of yacc.c */ -#line 2015 "program_parse.y" +#line 2025 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4654,7 +4664,7 @@ yyreduce: case 256: /* Line 1455 of yacc.c */ -#line 2024 "program_parse.y" +#line 2034 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4668,7 +4678,7 @@ yyreduce: case 257: /* Line 1455 of yacc.c */ -#line 2033 "program_parse.y" +#line 2043 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4682,7 +4692,7 @@ yyreduce: case 258: /* Line 1455 of yacc.c */ -#line 2044 "program_parse.y" +#line 2054 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} @@ -4691,7 +4701,7 @@ yyreduce: case 259: /* Line 1455 of yacc.c */ -#line 2050 "program_parse.y" +#line 2060 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4702,7 +4712,7 @@ yyreduce: case 260: /* Line 1455 of yacc.c */ -#line 2056 "program_parse.y" +#line 2066 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4716,7 +4726,7 @@ yyreduce: case 261: /* Line 1455 of yacc.c */ -#line 2065 "program_parse.y" +#line 2075 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4730,7 +4740,7 @@ yyreduce: case 262: /* Line 1455 of yacc.c */ -#line 2076 "program_parse.y" +#line 2086 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4739,7 +4749,7 @@ yyreduce: case 263: /* Line 1455 of yacc.c */ -#line 2080 "program_parse.y" +#line 2090 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4753,7 +4763,7 @@ yyreduce: case 264: /* Line 1455 of yacc.c */ -#line 2089 "program_parse.y" +#line 2099 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4767,91 +4777,91 @@ yyreduce: case 265: /* Line 1455 of yacc.c */ -#line 2099 "program_parse.y" +#line 2109 "program_parse.y" { (yyval.integer) = 0; ;} break; case 266: /* Line 1455 of yacc.c */ -#line 2100 "program_parse.y" +#line 2110 "program_parse.y" { (yyval.integer) = 0; ;} break; case 267: /* Line 1455 of yacc.c */ -#line 2101 "program_parse.y" +#line 2111 "program_parse.y" { (yyval.integer) = 1; ;} break; case 268: /* Line 1455 of yacc.c */ -#line 2104 "program_parse.y" +#line 2114 "program_parse.y" { (yyval.integer) = 0; ;} break; case 269: /* Line 1455 of yacc.c */ -#line 2105 "program_parse.y" +#line 2115 "program_parse.y" { (yyval.integer) = 0; ;} break; case 270: /* Line 1455 of yacc.c */ -#line 2106 "program_parse.y" +#line 2116 "program_parse.y" { (yyval.integer) = 1; ;} break; case 271: /* Line 1455 of yacc.c */ -#line 2109 "program_parse.y" +#line 2119 "program_parse.y" { (yyval.integer) = 0; ;} break; case 272: /* Line 1455 of yacc.c */ -#line 2110 "program_parse.y" +#line 2120 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 273: /* Line 1455 of yacc.c */ -#line 2113 "program_parse.y" +#line 2123 "program_parse.y" { (yyval.integer) = 0; ;} break; case 274: /* Line 1455 of yacc.c */ -#line 2114 "program_parse.y" +#line 2124 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 275: /* Line 1455 of yacc.c */ -#line 2117 "program_parse.y" +#line 2127 "program_parse.y" { (yyval.integer) = 0; ;} break; case 276: /* Line 1455 of yacc.c */ -#line 2118 "program_parse.y" +#line 2128 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 277: /* Line 1455 of yacc.c */ -#line 2122 "program_parse.y" +#line 2132 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4865,7 +4875,7 @@ yyreduce: case 278: /* Line 1455 of yacc.c */ -#line 2133 "program_parse.y" +#line 2143 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4879,7 +4889,7 @@ yyreduce: case 279: /* Line 1455 of yacc.c */ -#line 2144 "program_parse.y" +#line 2154 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4893,7 +4903,7 @@ yyreduce: case 280: /* Line 1455 of yacc.c */ -#line 2155 "program_parse.y" +#line 2165 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4922,7 +4932,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4926 "program_parse.tab.c" +#line 4936 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -5141,7 +5151,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 2184 "program_parse.y" +#line 2194 "program_parse.y" void @@ -5271,19 +5281,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; } @@ -5415,15 +5435,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++; } @@ -5463,15 +5488,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++; } @@ -5479,20 +5508,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; diff --git a/src/mesa/shader/program_parse.tab.h b/src/mesa/shader/program_parse.tab.h index 406100c859c..d8712b72684 100644 --- a/src/mesa/shader/program_parse.tab.h +++ b/src/mesa/shader/program_parse.tab.h @@ -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; diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 8ca6f9805b8..3f1a350c24d 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -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; diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h index c170948f73a..69396ca2c0f 100644 --- a/src/mesa/shader/program_parser.h +++ b/src/mesa/shader/program_parser.h @@ -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. diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index ee5a50ca82e..b62cfc36af1 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -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) { diff --git a/src/mesa/shader/slang/slang_codegen.h b/src/mesa/shader/slang/slang_codegen.h index ee3be55a459..461633fe346 100644 --- a/src/mesa/shader/slang/slang_codegen.h +++ b/src/mesa/shader/slang/slang_codegen.h @@ -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]; diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index f60ad9ee385..6499cfcb2fe 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -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) { diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c index be73094ca04..3a15d9d3ab5 100644 --- a/src/mesa/shader/slang/slang_compile_operation.c +++ b/src/mesa/shader/slang/slang_compile_operation.c @@ -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; diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 3e165c9febd..d00b67a279e 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -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 { diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index a311d4b4bd0..4ea9547cd92 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -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) { |