From: Thomas Balling Sørensen Date: Tue, 5 Oct 2010 12:25:29 +0000 (+0200) Subject: vl: changed video pipe to use the new gallium API within master X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d64d6f7712e5e8d8f962de3455a71fce8b2a8f78;p=mesa.git vl: changed video pipe to use the new gallium API within master --- diff --git a/src/gallium/auxiliary/vl/vl_bitstream_parser.h b/src/gallium/auxiliary/vl/vl_bitstream_parser.h index 30ec743fa75..eeb51dd4295 100644 --- a/src/gallium/auxiliary/vl/vl_bitstream_parser.h +++ b/src/gallium/auxiliary/vl/vl_bitstream_parser.h @@ -39,6 +39,10 @@ struct vl_bitstream_parser unsigned cursor; }; +inline void endian_swap_ushort(unsigned short *x); +inline void endian_swap_uint(unsigned int *x); +inline void endian_swap_ulonglong(unsigned long long *x); + bool vl_bitstream_parser_init(struct vl_bitstream_parser *parser, unsigned num_bitstreams, const void **bitstreams, diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c index 415dc92555f..ee7bf070037 100644 --- a/src/gallium/auxiliary/vl/vl_compositor.c +++ b/src/gallium/auxiliary/vl/vl_compositor.c @@ -555,7 +555,9 @@ static void draw_layers(struct vl_compositor *c, c->pipe->bind_fs_state(c->pipe, frag_shaders[i]); c->pipe->set_fragment_sampler_views(c->pipe, 1, &surface_view); - c->pipe->draw_arrays(c->pipe, PIPE_PRIM_TRIANGLES, i * 6, 6); + + + util_draw_arrays(c->pipe,PIPE_PRIM_TRIANGLES,i * 6,6); if (delete_view) { pipe_sampler_view_reference(&surface_view, NULL); diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c index e9024e4a409..8a8c155e8ec 100644 --- a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c +++ b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c @@ -1039,6 +1039,7 @@ flush(struct vl_mpeg12_mc_renderer *r) unsigned vb_start = 0; struct vertex_shader_consts *vs_consts; struct pipe_transfer *buf_transfer; + unsigned i; assert(r); @@ -1065,6 +1066,7 @@ flush(struct vl_mpeg12_mc_renderer *r) r->pipe->set_constant_buffer(r->pipe, PIPE_SHADER_VERTEX, 0, r->vs_const_buf); + if (num_macroblocks[MACROBLOCK_TYPE_INTRA] > 0) { r->pipe->set_vertex_buffers(r->pipe, 1, r->vertex_bufs.all); @@ -1074,8 +1076,8 @@ flush(struct vl_mpeg12_mc_renderer *r) r->pipe->bind_vs_state(r->pipe, r->i_vs); r->pipe->bind_fs_state(r->pipe, r->i_fs); - r->pipe->draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, - num_macroblocks[MACROBLOCK_TYPE_INTRA] * 24); + util_draw_arrays(r->pipe,PIPE_PRIM_TRIANGLES,vb_start,num_macroblocks[MACROBLOCK_TYPE_INTRA] * 24); + vb_start += num_macroblocks[MACROBLOCK_TYPE_INTRA] * 24; } @@ -1089,8 +1091,8 @@ flush(struct vl_mpeg12_mc_renderer *r) r->pipe->bind_vs_state(r->pipe, r->p_vs[0]); r->pipe->bind_fs_state(r->pipe, r->p_fs[0]); - r->pipe->draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, - num_macroblocks[MACROBLOCK_TYPE_FWD_FRAME_PRED] * 24); + util_draw_arrays(r->pipe,PIPE_PRIM_TRIANGLES,vb_start,num_macroblocks[MACROBLOCK_TYPE_FWD_FRAME_PRED] * 24); + vb_start += num_macroblocks[MACROBLOCK_TYPE_FWD_FRAME_PRED] * 24; } @@ -1104,8 +1106,8 @@ flush(struct vl_mpeg12_mc_renderer *r) r->pipe->bind_vs_state(r->pipe, r->p_vs[1]); r->pipe->bind_fs_state(r->pipe, r->p_fs[1]); - r->pipe->draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, - num_macroblocks[MACROBLOCK_TYPE_FWD_FIELD_PRED] * 24); + util_draw_arrays(r->pipe,PIPE_PRIM_TRIANGLES,vb_start,num_macroblocks[MACROBLOCK_TYPE_FWD_FIELD_PRED] * 24); + vb_start += num_macroblocks[MACROBLOCK_TYPE_FWD_FIELD_PRED] * 24; } @@ -1119,8 +1121,8 @@ flush(struct vl_mpeg12_mc_renderer *r) r->pipe->bind_vs_state(r->pipe, r->p_vs[0]); r->pipe->bind_fs_state(r->pipe, r->p_fs[0]); - r->pipe->draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, - num_macroblocks[MACROBLOCK_TYPE_BKWD_FRAME_PRED] * 24); + util_draw_arrays(r->pipe,PIPE_PRIM_TRIANGLES,vb_start,num_macroblocks[MACROBLOCK_TYPE_BKWD_FRAME_PRED] * 24); + vb_start += num_macroblocks[MACROBLOCK_TYPE_BKWD_FRAME_PRED] * 24; } @@ -1134,8 +1136,8 @@ flush(struct vl_mpeg12_mc_renderer *r) r->pipe->bind_vs_state(r->pipe, r->p_vs[1]); r->pipe->bind_fs_state(r->pipe, r->p_fs[1]); - r->pipe->draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, - num_macroblocks[MACROBLOCK_TYPE_BKWD_FIELD_PRED] * 24); + util_draw_arrays(r->pipe,PIPE_PRIM_TRIANGLES,vb_start,num_macroblocks[MACROBLOCK_TYPE_BKWD_FIELD_PRED] * 24); + vb_start += num_macroblocks[MACROBLOCK_TYPE_BKWD_FIELD_PRED] * 24; } @@ -1151,8 +1153,8 @@ flush(struct vl_mpeg12_mc_renderer *r) r->pipe->bind_vs_state(r->pipe, r->b_vs[0]); r->pipe->bind_fs_state(r->pipe, r->b_fs[0]); - r->pipe->draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, - num_macroblocks[MACROBLOCK_TYPE_BI_FRAME_PRED] * 24); + util_draw_arrays(r->pipe,PIPE_PRIM_TRIANGLES,vb_start,num_macroblocks[MACROBLOCK_TYPE_BI_FRAME_PRED] * 24); + vb_start += num_macroblocks[MACROBLOCK_TYPE_BI_FRAME_PRED] * 24; } @@ -1168,8 +1170,8 @@ flush(struct vl_mpeg12_mc_renderer *r) r->pipe->bind_vs_state(r->pipe, r->b_vs[1]); r->pipe->bind_fs_state(r->pipe, r->b_fs[1]); - r->pipe->draw_arrays(r->pipe, PIPE_PRIM_TRIANGLES, vb_start, - num_macroblocks[MACROBLOCK_TYPE_BI_FIELD_PRED] * 24); + util_draw_arrays(r->pipe,PIPE_PRIM_TRIANGLES,vb_start,num_macroblocks[MACROBLOCK_TYPE_BI_FIELD_PRED] * 24); + vb_start += num_macroblocks[MACROBLOCK_TYPE_BI_FIELD_PRED] * 24; } diff --git a/src/gallium/drivers/softpipe/sp_video_context.c b/src/gallium/drivers/softpipe/sp_video_context.c index 44df00e0b78..419ba946b89 100644 --- a/src/gallium/drivers/softpipe/sp_video_context.c +++ b/src/gallium/drivers/softpipe/sp_video_context.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "sp_public.h" #include "sp_texture.h" @@ -97,8 +98,8 @@ sp_mpeg12_is_format_supported(struct pipe_video_context *vpipe, if (geom & PIPE_TEXTURE_GEOM_NON_POWER_OF_TWO) return FALSE; - return ctx->pipe->screen->is_format_supported(ctx->pipe->screen, PIPE_TEXTURE_2D, - format, usage, geom); + return ctx->pipe->screen->is_format_supported(ctx->pipe->screen, format, PIPE_TEXTURE_2D, 1, + usage, geom); } static void @@ -125,29 +126,31 @@ sp_mpeg12_decode_macroblocks(struct pipe_video_context *vpipe, } static void -sp_mpeg12_surface_fill(struct pipe_video_context *vpipe, +sp_mpeg12_clear_render_target(struct pipe_video_context *vpipe, struct pipe_surface *dst, unsigned dstx, unsigned dsty, - unsigned width, unsigned height, - unsigned value) + const float *rgba, + unsigned width, unsigned height) { struct sp_mpeg12_context *ctx = (struct sp_mpeg12_context*)vpipe; assert(vpipe); assert(dst); - if (ctx->pipe->surface_fill) - ctx->pipe->surface_fill(ctx->pipe, dst, dstx, dsty, width, height, value); + if (ctx->pipe->clear_render_target) + ctx->pipe->clear_render_target(ctx->pipe, dst, rgba, dstx, dsty, width, height); else - util_surface_fill(ctx->pipe, dst, dstx, dsty, width, height, value); + util_clear_render_target(ctx->pipe, dst, rgba, dstx, dsty, width, height); } static void -sp_mpeg12_surface_copy(struct pipe_video_context *vpipe, - struct pipe_surface *dst, - unsigned dstx, unsigned dsty, - struct pipe_surface *src, - unsigned srcx, unsigned srcy, +sp_mpeg12_resource_copy_region(struct pipe_video_context *vpipe, + struct pipe_resource *dst, + struct pipe_subresource subdst, + unsigned dstx, unsigned dsty, unsigned dstz, + struct pipe_resource *src, + struct pipe_subresource subsrc, + unsigned srcx, unsigned srcy, unsigned srcz, unsigned width, unsigned height) { struct sp_mpeg12_context *ctx = (struct sp_mpeg12_context*)vpipe; @@ -155,10 +158,10 @@ sp_mpeg12_surface_copy(struct pipe_video_context *vpipe, assert(vpipe); assert(dst); - if (ctx->pipe->surface_copy) - ctx->pipe->surface_copy(ctx->pipe, dst, dstx, dsty, src, srcx, srcy, width, height); + if (ctx->pipe->resource_copy_region) + ctx->pipe->resource_copy_region(ctx->pipe, dst, subdst, dstx, dsty, dstz, src, subsrc, srcx, srcy, srcz, width, height); else - util_surface_copy(ctx->pipe, FALSE, dst, dstx, dsty, src, srcx, srcy, width, height); + util_resource_copy_region(ctx->pipe, dst, subdst, dstx, dsty, dstz, src, subsrc, srcx, srcy, srcz, width, height); } static struct pipe_transfer* @@ -339,12 +342,9 @@ init_pipe_state(struct sp_mpeg12_context *ctx) rast.flatshade = 1; rast.flatshade_first = 0; rast.light_twoside = 0; - rast.front_winding = PIPE_WINDING_CCW; - rast.cull_mode = PIPE_WINDING_CW; - rast.fill_cw = PIPE_POLYGON_MODE_FILL; - rast.fill_ccw = PIPE_POLYGON_MODE_FILL; - rast.offset_cw = 0; - rast.offset_ccw = 0; + rast.cull_face = PIPE_FACE_FRONT; + rast.fill_front = PIPE_POLYGON_MODE_FILL; + rast.fill_back = PIPE_POLYGON_MODE_FILL; rast.scissor = 0; rast.poly_smooth = 0; rast.poly_stipple_enable = 0; @@ -359,13 +359,15 @@ init_pipe_state(struct sp_mpeg12_context *ctx) rast.line_width = 1; rast.point_smooth = 0; rast.point_quad_rasterization = 0; - rast.point_size = 1; + rast.point_size_per_vertex = 1; rast.offset_units = 1; rast.offset_scale = 1; rast.gl_rasterization_rules = 1; + ctx->rast = ctx->pipe->create_rasterizer_state(ctx->pipe, &rast); ctx->pipe->bind_rasterizer_state(ctx->pipe, ctx->rast); + blend.independent_blend_enable = 0; blend.rt[0].blend_enable = 0; blend.rt[0].rgb_func = PIPE_BLEND_ADD; @@ -432,8 +434,8 @@ sp_mpeg12_create(struct pipe_context *pipe, enum pipe_video_profile profile, ctx->base.is_format_supported = sp_mpeg12_is_format_supported; ctx->base.decode_macroblocks = sp_mpeg12_decode_macroblocks; ctx->base.render_picture = sp_mpeg12_render_picture; - ctx->base.surface_fill = sp_mpeg12_surface_fill; - ctx->base.surface_copy = sp_mpeg12_surface_copy; + ctx->base.clear_render_target = sp_mpeg12_clear_render_target; + ctx->base.resource_copy_region = sp_mpeg12_resource_copy_region; ctx->base.get_transfer = sp_mpeg12_get_transfer; ctx->base.transfer_destroy = sp_mpeg12_transfer_destroy; ctx->base.transfer_map = sp_mpeg12_transfer_map; diff --git a/src/gallium/include/pipe/p_video_context.h b/src/gallium/include/pipe/p_video_context.h index 294dc464c36..21ed4d579cf 100644 --- a/src/gallium/include/pipe/p_video_context.h +++ b/src/gallium/include/pipe/p_video_context.h @@ -101,17 +101,19 @@ struct pipe_video_context struct pipe_video_rect *dst_area, struct pipe_fence_handle **fence); - void (*surface_fill)(struct pipe_video_context *vpipe, + void (*clear_render_target)(struct pipe_video_context *vpipe, struct pipe_surface *dst, unsigned dstx, unsigned dsty, - unsigned width, unsigned height, - unsigned value); + const float *rgba, + unsigned width, unsigned height); - void (*surface_copy)(struct pipe_video_context *vpipe, - struct pipe_surface *dst, - unsigned dstx, unsigned dsty, - struct pipe_surface *src, - unsigned srcx, unsigned srcy, + void (*resource_copy_region)(struct pipe_video_context *vpipe, + struct pipe_resource *dst, + struct pipe_subresource subdst, + unsigned dstx, unsigned dsty, unsigned dstz, + struct pipe_resource *src, + struct pipe_subresource subsrc, + unsigned srcx, unsigned srcy, unsigned srcz, unsigned width, unsigned height); struct pipe_transfer *(*get_transfer)(struct pipe_video_context *vpipe, diff --git a/src/gallium/state_trackers/vdpau/query.c b/src/gallium/state_trackers/vdpau/query.c index 86b5098f178..a3a8500a6f7 100644 --- a/src/gallium/state_trackers/vdpau/query.c +++ b/src/gallium/state_trackers/vdpau/query.c @@ -122,6 +122,7 @@ vlVdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities(VdpDevice device, VdpChromaTyp *is_supported = vlscreen->pscreen->is_format_supported(vlscreen->pscreen, FormatToPipe(bits_ycbcr_format), PIPE_TEXTURE_2D, + 1, PIPE_BIND_RENDER_TARGET, PIPE_TEXTURE_GEOM_NON_SQUARE ); diff --git a/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c b/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c index 0a7f324a77c..cc80583f088 100644 --- a/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c +++ b/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c @@ -82,7 +82,7 @@ vl_drawable_surface_get(struct vl_screen *vscreen, Drawable drawable) templat.height0 = height; templat.depth0 = 1; templat.usage = PIPE_USAGE_DEFAULT; - templat.bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_BLIT_SOURCE; + templat.bind = PIPE_BIND_RENDER_TARGET | PIPE_BIND_DISPLAY_TARGET; templat.flags = 0; drawable_tex = vscreen->pscreen->resource_create(vscreen->pscreen, &templat); diff --git a/src/glsl/glcpp/glcpp-parse.c b/src/glsl/glcpp/glcpp-parse.c index 1773ca5c13d..899e7841b3d 100644 --- a/src/glsl/glcpp/glcpp-parse.c +++ b/src/glsl/glcpp/glcpp-parse.c @@ -1,9 +1,10 @@ -/* A Bison parser, made by GNU Bison 2.4.3. */ + +/* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton implementation for Bison's Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -45,7 +46,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.3" +#define YYBISON_VERSION "2.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -219,7 +220,7 @@ add_builtin_define(glcpp_parser_t *parser, const char *name, int value); /* Line 189 of yacc.c */ -#line 223 "glcpp/glcpp-parse.c" +#line 224 "glcpp/glcpp-parse.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -307,7 +308,7 @@ typedef struct YYLTYPE /* Line 264 of yacc.c */ -#line 311 "glcpp/glcpp-parse.c" +#line 312 "glcpp/glcpp-parse.c" #ifdef short # undef short @@ -357,7 +358,7 @@ typedef short int yytype_int16; #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ -# if defined YYENABLE_NLS && YYENABLE_NLS +# if YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) @@ -945,18 +946,9 @@ static const yytype_uint8 yystos[] = /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. However, - YYFAIL appears to be in use. Nevertheless, it is formally deprecated - in Bison 2.4.2's NEWS entry, where a plan to phase it out is - discussed. */ + Once GCC version 2 has supplanted version 1, this can go. */ #define YYFAIL goto yyerrlab -#if defined YYFAIL - /* This is here to suppress warnings from the GCC cpp's - -Wunused-macros. Normally we don't worry about that warning, but - some users do, and we want to make it easy for users to remove - YYFAIL uses, which will produce warnings from Bison 2.5. */ -#endif #define YYRECOVERING() (!!yyerrstatus) @@ -1013,7 +1005,7 @@ while (YYID (0)) we won't break user code: when these are the locations we know. */ #ifndef YY_LOCATION_PRINT -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +# if YYLTYPE_IS_TRIVIAL # define YY_LOCATION_PRINT(File, Loc) \ fprintf (File, "%d.%d-%d.%d", \ (Loc).first_line, (Loc).first_column, \ @@ -1555,7 +1547,7 @@ YYLTYPE yylloc; YYLTYPE *yylsp; /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[3]; + YYLTYPE yyerror_range[2]; YYSIZE_T yystacksize; @@ -1602,7 +1594,7 @@ YYLTYPE yylloc; yyvsp = yyvs; yylsp = yyls; -#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL +#if YYLTYPE_IS_TRIVIAL /* Initialize the default location before parsing starts. */ yylloc.first_line = yylloc.last_line = 1; yylloc.first_column = yylloc.last_column = 1; @@ -1610,7 +1602,7 @@ YYLTYPE yylloc; /* User initialization code. */ -/* Line 1251 of yacc.c */ +/* Line 1242 of yacc.c */ #line 155 "glcpp/glcpp-parse.y" { yylloc.first_line = 1; @@ -1620,8 +1612,8 @@ YYLTYPE yylloc; yylloc.source = 0; } -/* Line 1251 of yacc.c */ -#line 1625 "glcpp/glcpp-parse.c" +/* Line 1242 of yacc.c */ +#line 1617 "glcpp/glcpp-parse.c" yylsp[0] = yylloc; goto yysetstate; @@ -1808,7 +1800,7 @@ yyreduce: { case 4: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 194 "glcpp/glcpp-parse.y" { glcpp_print(parser->output, "\n"); @@ -1817,7 +1809,7 @@ yyreduce: case 5: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 197 "glcpp/glcpp-parse.y" { _glcpp_parser_print_expanded_token_list (parser, (yyvsp[(1) - (1)].token_list)); @@ -1828,7 +1820,7 @@ yyreduce: case 8: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 207 "glcpp/glcpp-parse.y" { _glcpp_parser_skip_stack_push_if (parser, & (yylsp[(1) - (3)]), (yyvsp[(2) - (3)].ival)); @@ -1837,7 +1829,7 @@ yyreduce: case 9: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 210 "glcpp/glcpp-parse.y" { _glcpp_parser_skip_stack_change_if (parser, & (yylsp[(1) - (3)]), "elif", (yyvsp[(2) - (3)].ival)); @@ -1846,7 +1838,7 @@ yyreduce: case 10: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 216 "glcpp/glcpp-parse.y" { _define_object_macro (parser, & (yylsp[(2) - (4)]), (yyvsp[(2) - (4)].str), (yyvsp[(3) - (4)].token_list)); @@ -1855,7 +1847,7 @@ yyreduce: case 11: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 219 "glcpp/glcpp-parse.y" { _define_function_macro (parser, & (yylsp[(2) - (6)]), (yyvsp[(2) - (6)].str), NULL, (yyvsp[(5) - (6)].token_list)); @@ -1864,7 +1856,7 @@ yyreduce: case 12: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 222 "glcpp/glcpp-parse.y" { _define_function_macro (parser, & (yylsp[(2) - (7)]), (yyvsp[(2) - (7)].str), (yyvsp[(4) - (7)].string_list), (yyvsp[(6) - (7)].token_list)); @@ -1873,7 +1865,7 @@ yyreduce: case 13: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 225 "glcpp/glcpp-parse.y" { macro_t *macro = hash_table_find (parser->defines, (yyvsp[(2) - (3)].str)); @@ -1887,7 +1879,7 @@ yyreduce: case 14: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 233 "glcpp/glcpp-parse.y" { /* Be careful to only evaluate the 'if' expression if @@ -1912,7 +1904,7 @@ yyreduce: case 15: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 252 "glcpp/glcpp-parse.y" { /* #if without an expression is only an error if we @@ -1928,7 +1920,7 @@ yyreduce: case 16: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 262 "glcpp/glcpp-parse.y" { macro_t *macro = hash_table_find (parser->defines, (yyvsp[(2) - (4)].str)); @@ -1939,7 +1931,7 @@ yyreduce: case 17: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 267 "glcpp/glcpp-parse.y" { macro_t *macro = hash_table_find (parser->defines, (yyvsp[(2) - (4)].str)); @@ -1950,7 +1942,7 @@ yyreduce: case 18: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 272 "glcpp/glcpp-parse.y" { /* Be careful to only evaluate the 'elif' expression @@ -1975,7 +1967,7 @@ yyreduce: case 19: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 291 "glcpp/glcpp-parse.y" { /* #elif without an expression is an error unless we @@ -1996,7 +1988,7 @@ yyreduce: case 20: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 306 "glcpp/glcpp-parse.y" { _glcpp_parser_skip_stack_change_if (parser, & (yylsp[(1) - (2)]), "else", 1); @@ -2005,7 +1997,7 @@ yyreduce: case 21: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 309 "glcpp/glcpp-parse.y" { _glcpp_parser_skip_stack_pop (parser, & (yylsp[(1) - (2)])); @@ -2014,7 +2006,7 @@ yyreduce: case 22: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 312 "glcpp/glcpp-parse.y" { macro_t *macro = hash_table_find (parser->defines, "__VERSION__"); @@ -2033,7 +2025,7 @@ yyreduce: case 24: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 329 "glcpp/glcpp-parse.y" { if (strlen ((yyvsp[(1) - (1)].str)) >= 3 && strncmp ((yyvsp[(1) - (1)].str), "0x", 2) == 0) { @@ -2048,7 +2040,7 @@ yyreduce: case 25: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 338 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (1)].ival); @@ -2057,7 +2049,7 @@ yyreduce: case 27: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 344 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) || (yyvsp[(3) - (3)].ival); @@ -2066,7 +2058,7 @@ yyreduce: case 28: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 347 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) && (yyvsp[(3) - (3)].ival); @@ -2075,7 +2067,7 @@ yyreduce: case 29: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 350 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) | (yyvsp[(3) - (3)].ival); @@ -2084,7 +2076,7 @@ yyreduce: case 30: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 353 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) ^ (yyvsp[(3) - (3)].ival); @@ -2093,7 +2085,7 @@ yyreduce: case 31: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 356 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) & (yyvsp[(3) - (3)].ival); @@ -2102,7 +2094,7 @@ yyreduce: case 32: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 359 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) != (yyvsp[(3) - (3)].ival); @@ -2111,7 +2103,7 @@ yyreduce: case 33: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 362 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) == (yyvsp[(3) - (3)].ival); @@ -2120,7 +2112,7 @@ yyreduce: case 34: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 365 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) >= (yyvsp[(3) - (3)].ival); @@ -2129,7 +2121,7 @@ yyreduce: case 35: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 368 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) <= (yyvsp[(3) - (3)].ival); @@ -2138,7 +2130,7 @@ yyreduce: case 36: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 371 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) > (yyvsp[(3) - (3)].ival); @@ -2147,7 +2139,7 @@ yyreduce: case 37: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 374 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) < (yyvsp[(3) - (3)].ival); @@ -2156,7 +2148,7 @@ yyreduce: case 38: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 377 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) >> (yyvsp[(3) - (3)].ival); @@ -2165,7 +2157,7 @@ yyreduce: case 39: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 380 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) << (yyvsp[(3) - (3)].ival); @@ -2174,7 +2166,7 @@ yyreduce: case 40: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 383 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) - (yyvsp[(3) - (3)].ival); @@ -2183,7 +2175,7 @@ yyreduce: case 41: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 386 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) + (yyvsp[(3) - (3)].ival); @@ -2192,7 +2184,7 @@ yyreduce: case 42: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 389 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) % (yyvsp[(3) - (3)].ival); @@ -2201,7 +2193,7 @@ yyreduce: case 43: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 392 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) / (yyvsp[(3) - (3)].ival); @@ -2210,7 +2202,7 @@ yyreduce: case 44: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 395 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(1) - (3)].ival) * (yyvsp[(3) - (3)].ival); @@ -2219,7 +2211,7 @@ yyreduce: case 45: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 398 "glcpp/glcpp-parse.y" { (yyval.ival) = ! (yyvsp[(2) - (2)].ival); @@ -2228,7 +2220,7 @@ yyreduce: case 46: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 401 "glcpp/glcpp-parse.y" { (yyval.ival) = ~ (yyvsp[(2) - (2)].ival); @@ -2237,7 +2229,7 @@ yyreduce: case 47: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 404 "glcpp/glcpp-parse.y" { (yyval.ival) = - (yyvsp[(2) - (2)].ival); @@ -2246,7 +2238,7 @@ yyreduce: case 48: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 407 "glcpp/glcpp-parse.y" { (yyval.ival) = + (yyvsp[(2) - (2)].ival); @@ -2255,7 +2247,7 @@ yyreduce: case 49: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 410 "glcpp/glcpp-parse.y" { (yyval.ival) = (yyvsp[(2) - (3)].ival); @@ -2264,7 +2256,7 @@ yyreduce: case 50: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 416 "glcpp/glcpp-parse.y" { (yyval.string_list) = _string_list_create (parser); @@ -2275,7 +2267,7 @@ yyreduce: case 51: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 421 "glcpp/glcpp-parse.y" { (yyval.string_list) = (yyvsp[(1) - (3)].string_list); @@ -2286,14 +2278,14 @@ yyreduce: case 52: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 429 "glcpp/glcpp-parse.y" { (yyval.token_list) = NULL; ;} break; case 54: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 434 "glcpp/glcpp-parse.y" { yyerror (& (yylsp[(1) - (2)]), parser, "Invalid tokens after #"); @@ -2302,14 +2294,14 @@ yyreduce: case 55: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 440 "glcpp/glcpp-parse.y" { (yyval.token_list) = NULL; ;} break; case 58: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 446 "glcpp/glcpp-parse.y" { glcpp_warning(&(yylsp[(1) - (1)]), parser, "extra tokens at end of directive"); @@ -2318,7 +2310,7 @@ yyreduce: case 59: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 453 "glcpp/glcpp-parse.y" { int v = hash_table_find (parser->defines, (yyvsp[(2) - (2)].str)) ? 1 : 0; @@ -2328,7 +2320,7 @@ yyreduce: case 60: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 457 "glcpp/glcpp-parse.y" { int v = hash_table_find (parser->defines, (yyvsp[(3) - (4)].str)) ? 1 : 0; @@ -2338,7 +2330,7 @@ yyreduce: case 62: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 466 "glcpp/glcpp-parse.y" { parser->space_tokens = 1; @@ -2350,7 +2342,7 @@ yyreduce: case 63: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 472 "glcpp/glcpp-parse.y" { (yyval.token_list) = (yyvsp[(1) - (2)].token_list); @@ -2361,7 +2353,7 @@ yyreduce: case 64: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 480 "glcpp/glcpp-parse.y" { parser->space_tokens = 1; @@ -2373,7 +2365,7 @@ yyreduce: case 65: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 486 "glcpp/glcpp-parse.y" { (yyval.token_list) = (yyvsp[(1) - (2)].token_list); @@ -2384,7 +2376,7 @@ yyreduce: case 66: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 494 "glcpp/glcpp-parse.y" { (yyval.token) = _token_create_str (parser, IDENTIFIER, (yyvsp[(1) - (1)].str)); @@ -2394,7 +2386,7 @@ yyreduce: case 67: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 498 "glcpp/glcpp-parse.y" { (yyval.token) = _token_create_str (parser, INTEGER_STRING, (yyvsp[(1) - (1)].str)); @@ -2404,7 +2396,7 @@ yyreduce: case 68: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 502 "glcpp/glcpp-parse.y" { (yyval.token) = _token_create_ival (parser, (yyvsp[(1) - (1)].ival), (yyvsp[(1) - (1)].ival)); @@ -2414,7 +2406,7 @@ yyreduce: case 69: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 506 "glcpp/glcpp-parse.y" { (yyval.token) = _token_create_str (parser, OTHER, (yyvsp[(1) - (1)].str)); @@ -2424,7 +2416,7 @@ yyreduce: case 70: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 510 "glcpp/glcpp-parse.y" { (yyval.token) = _token_create_ival (parser, SPACE, SPACE); @@ -2434,225 +2426,225 @@ yyreduce: case 71: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 517 "glcpp/glcpp-parse.y" { (yyval.ival) = '['; ;} break; case 72: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 518 "glcpp/glcpp-parse.y" { (yyval.ival) = ']'; ;} break; case 73: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 519 "glcpp/glcpp-parse.y" { (yyval.ival) = '('; ;} break; case 74: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 520 "glcpp/glcpp-parse.y" { (yyval.ival) = ')'; ;} break; case 75: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 521 "glcpp/glcpp-parse.y" { (yyval.ival) = '{'; ;} break; case 76: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 522 "glcpp/glcpp-parse.y" { (yyval.ival) = '}'; ;} break; case 77: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 523 "glcpp/glcpp-parse.y" { (yyval.ival) = '.'; ;} break; case 78: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 524 "glcpp/glcpp-parse.y" { (yyval.ival) = '&'; ;} break; case 79: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 525 "glcpp/glcpp-parse.y" { (yyval.ival) = '*'; ;} break; case 80: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 526 "glcpp/glcpp-parse.y" { (yyval.ival) = '+'; ;} break; case 81: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 527 "glcpp/glcpp-parse.y" { (yyval.ival) = '-'; ;} break; case 82: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 528 "glcpp/glcpp-parse.y" { (yyval.ival) = '~'; ;} break; case 83: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 529 "glcpp/glcpp-parse.y" { (yyval.ival) = '!'; ;} break; case 84: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 530 "glcpp/glcpp-parse.y" { (yyval.ival) = '/'; ;} break; case 85: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 531 "glcpp/glcpp-parse.y" { (yyval.ival) = '%'; ;} break; case 86: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 532 "glcpp/glcpp-parse.y" { (yyval.ival) = LEFT_SHIFT; ;} break; case 87: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 533 "glcpp/glcpp-parse.y" { (yyval.ival) = RIGHT_SHIFT; ;} break; case 88: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 534 "glcpp/glcpp-parse.y" { (yyval.ival) = '<'; ;} break; case 89: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 535 "glcpp/glcpp-parse.y" { (yyval.ival) = '>'; ;} break; case 90: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 536 "glcpp/glcpp-parse.y" { (yyval.ival) = LESS_OR_EQUAL; ;} break; case 91: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 537 "glcpp/glcpp-parse.y" { (yyval.ival) = GREATER_OR_EQUAL; ;} break; case 92: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 538 "glcpp/glcpp-parse.y" { (yyval.ival) = EQUAL; ;} break; case 93: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 539 "glcpp/glcpp-parse.y" { (yyval.ival) = NOT_EQUAL; ;} break; case 94: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 540 "glcpp/glcpp-parse.y" { (yyval.ival) = '^'; ;} break; case 95: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 541 "glcpp/glcpp-parse.y" { (yyval.ival) = '|'; ;} break; case 96: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 542 "glcpp/glcpp-parse.y" { (yyval.ival) = AND; ;} break; case 97: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 543 "glcpp/glcpp-parse.y" { (yyval.ival) = OR; ;} break; case 98: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 544 "glcpp/glcpp-parse.y" { (yyval.ival) = ';'; ;} break; case 99: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 545 "glcpp/glcpp-parse.y" { (yyval.ival) = ','; ;} break; case 100: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 546 "glcpp/glcpp-parse.y" { (yyval.ival) = '='; ;} break; case 101: -/* Line 1464 of yacc.c */ +/* Line 1455 of yacc.c */ #line 547 "glcpp/glcpp-parse.y" { (yyval.ival) = PASTE; ;} break; -/* Line 1464 of yacc.c */ -#line 2656 "glcpp/glcpp-parse.c" +/* Line 1455 of yacc.c */ +#line 2648 "glcpp/glcpp-parse.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2724,7 +2716,7 @@ yyerrlab: #endif } - yyerror_range[1] = yylloc; + yyerror_range[0] = yylloc; if (yyerrstatus == 3) { @@ -2761,7 +2753,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - yyerror_range[1] = yylsp[1-yylen]; + yyerror_range[0] = yylsp[1-yylen]; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); @@ -2795,7 +2787,7 @@ yyerrlab1: if (yyssp == yyss) YYABORT; - yyerror_range[1] = *yylsp; + yyerror_range[0] = *yylsp; yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp, parser); YYPOPSTACK (1); @@ -2805,10 +2797,10 @@ yyerrlab1: *++yyvsp = yylval; - yyerror_range[2] = yylloc; + yyerror_range[1] = yylloc; /* Using YYLLOC is tempting, but would change the location of the lookahead. YYLOC is available though. */ - YYLLOC_DEFAULT (yyloc, yyerror_range, 2); + YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); *++yylsp = yyloc; /* Shift the error token. */ @@ -2870,7 +2862,7 @@ yyreturn: -/* Line 1684 of yacc.c */ +/* Line 1675 of yacc.c */ #line 550 "glcpp/glcpp-parse.y" diff --git a/src/glsl/glcpp/glcpp-parse.h b/src/glsl/glcpp/glcpp-parse.h index 40556854f38..50758930e9c 100644 --- a/src/glsl/glcpp/glcpp-parse.h +++ b/src/glsl/glcpp/glcpp-parse.h @@ -1,9 +1,10 @@ -/* A Bison parser, made by GNU Bison 2.4.3. */ + +/* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton interface for Bison's Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by