Mesa (glsl-pp-rework-2): glsl/pp: Store both line number and file index in a single token.
Module: Mesa Branch: glsl-pp-rework-2 Commit: 9a1447d449209635e481c7f9bd02084864e17419 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9a1447d449209635e481c7f9bd02084864e17419 Author: Michal Krol mic...@vmware.com Date: Thu Sep 24 08:43:05 2009 +0200 glsl/pp: Store both line number and file index in a single token. --- src/glsl/pp/sl_pp_line.c| 31 ++- src/glsl/pp/sl_pp_process.c |3 ++- src/glsl/pp/sl_pp_token.h |7 --- 3 files changed, 16 insertions(+), 25 deletions(-) diff --git a/src/glsl/pp/sl_pp_line.c b/src/glsl/pp/sl_pp_line.c index e8f7510..41ddaf6 100644 --- a/src/glsl/pp/sl_pp_line.c +++ b/src/glsl/pp/sl_pp_line.c @@ -42,6 +42,7 @@ sl_pp_process_line(struct sl_pp_context *context, int line_number = -1; int file_number = -1; unsigned int line; + unsigned int file; memset(state, 0, sizeof(state)); for (i = first; i last;) { @@ -94,37 +95,25 @@ sl_pp_process_line(struct sl_pp_context *context, free(state.out); line = atoi(sl_pp_context_cstr(context, line_number)); + if (file_number != -1) { + file = atoi(sl_pp_context_cstr(context, file_number)); + } else { + file = context-file; + } - if (context-line != line) { + if (context-line != line || context-file != file) { struct sl_pp_token_info ti; ti.token = SL_PP_LINE; - ti.data.line = line; + ti.data.line.lineno = line; + ti.data.line.fileno = file; if (sl_pp_process_out(pstate, ti)) { strcpy(context-error_msg, out of memory); return -1; } context-line = line; - } - - if (file_number != -1) { - unsigned int file; - - file = atoi(sl_pp_context_cstr(context, file_number)); - - if (context-file != file) { - struct sl_pp_token_info ti; - - ti.token = SL_PP_FILE; - ti.data.file = file; - if (sl_pp_process_out(pstate, ti)) { -strcpy(context-error_msg, out of memory); -return -1; - } - - context-file = file; - } + context-file = file; } return 0; diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index ab2f2d8..67ed588 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -79,7 +79,8 @@ sl_pp_process(struct sl_pp_context *context, struct sl_pp_token_info ti; ti.token = SL_PP_LINE; - ti.data.line = context-line - 1; + ti.data.line.lineno = context-line - 1; + ti.data.line.fileno = context-file; if (sl_pp_process_out(state, ti)) { strcpy(context-error_msg, out of memory); return -1; diff --git a/src/glsl/pp/sl_pp_token.h b/src/glsl/pp/sl_pp_token.h index 2a7b79e..b1f3389 100644 --- a/src/glsl/pp/sl_pp_token.h +++ b/src/glsl/pp/sl_pp_token.h @@ -96,7 +96,6 @@ enum sl_pp_token { SL_PP_EXTENSION_DISABLE, SL_PP_LINE, - SL_PP_FILE, SL_PP_EOF }; @@ -108,8 +107,10 @@ union sl_pp_token_data { char other; int pragma; int extension; - unsigned int line; - unsigned int file; + union { + unsigned int lineno: 24; + unsigned int fileno: 8; + } line; }; struct sl_pp_token_info { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (glsl-pp-rework-2): glsl/pp: Use struct instead of union.
Module: Mesa Branch: glsl-pp-rework-2 Commit: a58360dbc2ee1ef919ecd50bd46cb57a151b8550 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a58360dbc2ee1ef919ecd50bd46cb57a151b8550 Author: Michal Krol mic...@vmware.com Date: Thu Sep 24 09:04:15 2009 +0200 glsl/pp: Use struct instead of union. --- src/glsl/pp/sl_pp_token.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/glsl/pp/sl_pp_token.h b/src/glsl/pp/sl_pp_token.h index b1f3389..cece30b 100644 --- a/src/glsl/pp/sl_pp_token.h +++ b/src/glsl/pp/sl_pp_token.h @@ -107,7 +107,7 @@ union sl_pp_token_data { char other; int pragma; int extension; - union { + struct { unsigned int lineno: 24; unsigned int fileno: 8; } line; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (glsl-pp-rework-2): glsl/apps: Fix apps after pp interface changes.
Module: Mesa Branch: glsl-pp-rework-2 Commit: 13f9a39cea81bf8f1efd4aca1467c63a49a42dab URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=13f9a39cea81bf8f1efd4aca1467c63a49a42dab Author: Michal Krol mic...@vmware.com Date: Thu Sep 24 08:43:54 2009 +0200 glsl/apps: Fix apps after pp interface changes. --- src/glsl/apps/process.c |6 +- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index 4fff357..28b415c 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -367,11 +367,7 @@ main(int argc, break; case SL_PP_LINE: - fprintf(out, #line %u, outtokens[i].data.line); - break; - - case SL_PP_FILE: - fprintf(out, #file %u, outtokens[i].data.file); + fprintf(out, #line %u %u, outtokens[i].data.line.lineno, outtokens[i].data.line.fileno); break; default: ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (glsl-pp-rework-2): glsl/apps: Allow builds on all platforms.
Module: Mesa Branch: glsl-pp-rework-2 Commit: db097a9a3ff532d37875b8cd911dda0515a60dcd URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=db097a9a3ff532d37875b8cd911dda0515a60dcd Author: Michal Krol mic...@vmware.com Date: Thu Sep 24 10:54:56 2009 +0200 glsl/apps: Allow builds on all platforms. --- src/glsl/apps/SConscript |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/src/glsl/apps/SConscript b/src/glsl/apps/SConscript index 12a0018..5802011 100644 --- a/src/glsl/apps/SConscript +++ b/src/glsl/apps/SConscript @@ -1,8 +1,5 @@ Import('*') -if env['platform'] not in ['windows']: -Return() - env = env.Clone() if env['platform'] == 'windows': ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (glsl-pp-rework-2): glsl/apps: Include missing header, properly escape format strings.
Module: Mesa Branch: glsl-pp-rework-2 Commit: e8e3fe15e1b0f75c43e197f8875a7fae1468f584 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e8e3fe15e1b0f75c43e197f8875a7fae1468f584 Author: Michal Krol mic...@vmware.com Date: Thu Sep 24 10:55:37 2009 +0200 glsl/apps: Include missing header, properly escape format strings. --- src/glsl/apps/process.c |5 +++-- src/glsl/apps/purify.c |1 + src/glsl/apps/tokenise.c |5 +++-- src/glsl/apps/version.c |1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index 28b415c..e20b68b 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -27,6 +27,7 @@ #include stdio.h #include stdlib.h +#include string.h #include assert.h #include ../pp/sl_pp_public.h @@ -235,11 +236,11 @@ main(int argc, break; case SL_PP_MODASSIGN: - fprintf(out, %= ); + fprintf(out, %%= ); break; case SL_PP_MODULO: - fprintf(out, % ); + fprintf(out, %% ); break; case SL_PP_LSHIFTASSIGN: diff --git a/src/glsl/apps/purify.c b/src/glsl/apps/purify.c index 435bdbe..53ba253 100644 --- a/src/glsl/apps/purify.c +++ b/src/glsl/apps/purify.c @@ -27,6 +27,7 @@ #include stdio.h #include stdlib.h +#include string.h #include ../pp/sl_pp_public.h diff --git a/src/glsl/apps/tokenise.c b/src/glsl/apps/tokenise.c index 9f95424..d6b9c4f 100644 --- a/src/glsl/apps/tokenise.c +++ b/src/glsl/apps/tokenise.c @@ -27,6 +27,7 @@ #include stdio.h #include stdlib.h +#include string.h #include assert.h #include ../pp/sl_pp_public.h @@ -219,11 +220,11 @@ main(int argc, break; case SL_PP_MODASSIGN: - fprintf(out, %= ); + fprintf(out, %%= ); break; case SL_PP_MODULO: - fprintf(out, % ); + fprintf(out, %% ); break; case SL_PP_LSHIFTASSIGN: diff --git a/src/glsl/apps/version.c b/src/glsl/apps/version.c index f259431..4570f86 100644 --- a/src/glsl/apps/version.c +++ b/src/glsl/apps/version.c @@ -27,6 +27,7 @@ #include stdio.h #include stdlib.h +#include string.h #include assert.h #include ../pp/sl_pp_public.h ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (glsl-pp-rework-2): glsl/pp: Allow builds on all platforms.
Module: Mesa Branch: glsl-pp-rework-2 Commit: e1eed5670246e08119ed7e4afa5313e7717b8128 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e1eed5670246e08119ed7e4afa5313e7717b8128 Author: Michal Krol mic...@vmware.com Date: Thu Sep 24 10:56:01 2009 +0200 glsl/pp: Allow builds on all platforms. --- src/glsl/pp/SConscript |3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/src/glsl/pp/SConscript b/src/glsl/pp/SConscript index 621db1e..5bd615c 100644 --- a/src/glsl/pp/SConscript +++ b/src/glsl/pp/SConscript @@ -1,8 +1,5 @@ Import('*') -if env['platform'] not in ['windows']: -Return() - env = env.Clone() glsl = env.StaticLibrary( ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (glsl-pp-rework-2): glsl/pp: Avoid using `__VERSION__' as an identifier.
Module: Mesa Branch: glsl-pp-rework-2 Commit: 69fec23251740c3071ffc3fefc8981599bdb22ef URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=69fec23251740c3071ffc3fefc8981599bdb22ef Author: Michal Krol mic...@vmware.com Date: Thu Sep 24 10:57:32 2009 +0200 glsl/pp: Avoid using `__VERSION__' as an identifier. --- src/glsl/pp/sl_pp_dict.c |2 +- src/glsl/pp/sl_pp_dict.h |5 - src/glsl/pp/sl_pp_macro.c |3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/glsl/pp/sl_pp_dict.c b/src/glsl/pp/sl_pp_dict.c index 0e1fa36..82fb912 100644 --- a/src/glsl/pp/sl_pp_dict.c +++ b/src/glsl/pp/sl_pp_dict.c @@ -56,7 +56,7 @@ sl_pp_dict_init(struct sl_pp_context *context) ADD_NAME_STR(context, ___LINE__, __LINE__); ADD_NAME_STR(context, ___FILE__, __FILE__); - ADD_NAME(context, __VERSION__); + ADD_NAME_STR(context, ___VERSION__, __VERSION__); ADD_NAME(context, optimize); ADD_NAME(context, debug); diff --git a/src/glsl/pp/sl_pp_dict.h b/src/glsl/pp/sl_pp_dict.h index 683752e..49f0e0b 100644 --- a/src/glsl/pp/sl_pp_dict.h +++ b/src/glsl/pp/sl_pp_dict.h @@ -28,6 +28,9 @@ #ifndef SL_PP_DICT_H #define SL_PP_DICT_H + +struct sl_pp_context; + struct sl_pp_dict { int all; int _GL_ARB_draw_buffers; @@ -42,7 +45,7 @@ struct sl_pp_dict { int ___LINE__; int ___FILE__; - int __VERSION__; + int ___VERSION__; int optimize; int debug; diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c index 3956ba3..a4e7886 100644 --- a/src/glsl/pp/sl_pp_macro.c +++ b/src/glsl/pp/sl_pp_macro.c @@ -27,6 +27,7 @@ #include stdlib.h #include stdio.h +#include string.h #include sl_pp_macro.h #include sl_pp_process.h @@ -149,7 +150,7 @@ sl_pp_macro_expand(struct sl_pp_context *context, (*pi)++; return 0; } - if (macro_name == context-dict.__VERSION__) { + if (macro_name == context-dict.___VERSION__) { if (!mute _out_number(context, state, 110)) { return -1; } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (glsl-pp-rework-2): glsl/pp: Add forward decls to silence gcc warnings .
Module: Mesa Branch: glsl-pp-rework-2 Commit: 92e33569f39a2fa9061a0c35c233c1db33820033 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=92e33569f39a2fa9061a0c35c233c1db33820033 Author: Michal Krol mic...@vmware.com Date: Thu Sep 24 10:57:55 2009 +0200 glsl/pp: Add forward decls to silence gcc warnings. --- src/glsl/pp/sl_pp_macro.h |3 +++ src/glsl/pp/sl_pp_token.h |2 ++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/src/glsl/pp/sl_pp_macro.h b/src/glsl/pp/sl_pp_macro.h index 7af11c5..e3ae2fc 100644 --- a/src/glsl/pp/sl_pp_macro.h +++ b/src/glsl/pp/sl_pp_macro.h @@ -31,6 +31,9 @@ #include sl_pp_token.h +struct sl_pp_context; +struct sl_pp_process_state; + struct sl_pp_macro_formal_arg { int name; struct sl_pp_macro_formal_arg *next; diff --git a/src/glsl/pp/sl_pp_token.h b/src/glsl/pp/sl_pp_token.h index cece30b..29c7571 100644 --- a/src/glsl/pp/sl_pp_token.h +++ b/src/glsl/pp/sl_pp_token.h @@ -29,6 +29,8 @@ #define SL_PP_TOKEN_H +struct sl_pp_context; + enum sl_pp_token { SL_PP_WHITESPACE, SL_PP_NEWLINE, ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (glsl-pp-rework-2): glsl/pp: Include missing headers.
Module: Mesa Branch: glsl-pp-rework-2 Commit: 7a95a3c7c4ba49ec174681c36951e3c0672df06c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7a95a3c7c4ba49ec174681c36951e3c0672df06c Author: Michal Krol mic...@vmware.com Date: Thu Sep 24 10:56:46 2009 +0200 glsl/pp: Include missing headers. --- src/glsl/pp/sl_pp_context.c|1 + src/glsl/pp/sl_pp_error.c |1 + src/glsl/pp/sl_pp_expression.c |1 + src/glsl/pp/sl_pp_extension.c |1 + src/glsl/pp/sl_pp_if.c |1 + src/glsl/pp/sl_pp_line.c |1 + src/glsl/pp/sl_pp_pragma.c |1 + src/glsl/pp/sl_pp_process.c|2 ++ src/glsl/pp/sl_pp_token.c |1 + src/glsl/pp/sl_pp_version.c|1 + 10 files changed, 11 insertions(+), 0 deletions(-) diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c index fd205de..8ce189d 100644 --- a/src/glsl/pp/sl_pp_context.c +++ b/src/glsl/pp/sl_pp_context.c @@ -26,6 +26,7 @@ **/ #include stdlib.h +#include string.h #include sl_pp_public.h #include sl_pp_context.h diff --git a/src/glsl/pp/sl_pp_error.c b/src/glsl/pp/sl_pp_error.c index df9b191..a9eeff9 100644 --- a/src/glsl/pp/sl_pp_error.c +++ b/src/glsl/pp/sl_pp_error.c @@ -26,6 +26,7 @@ **/ #include stdlib.h +#include string.h #include sl_pp_process.h #include sl_pp_public.h diff --git a/src/glsl/pp/sl_pp_expression.c b/src/glsl/pp/sl_pp_expression.c index 3f6dfb5..ec90478 100644 --- a/src/glsl/pp/sl_pp_expression.c +++ b/src/glsl/pp/sl_pp_expression.c @@ -26,6 +26,7 @@ **/ #include stdlib.h +#include string.h #include sl_pp_expression.h #include sl_pp_public.h diff --git a/src/glsl/pp/sl_pp_extension.c b/src/glsl/pp/sl_pp_extension.c index 33193d0..4148fd9 100644 --- a/src/glsl/pp/sl_pp_extension.c +++ b/src/glsl/pp/sl_pp_extension.c @@ -26,6 +26,7 @@ **/ #include stdlib.h +#include string.h #include sl_pp_process.h diff --git a/src/glsl/pp/sl_pp_if.c b/src/glsl/pp/sl_pp_if.c index c8e958e..a0b3635 100644 --- a/src/glsl/pp/sl_pp_if.c +++ b/src/glsl/pp/sl_pp_if.c @@ -26,6 +26,7 @@ **/ #include stdlib.h +#include string.h #include sl_pp_expression.h #include sl_pp_process.h diff --git a/src/glsl/pp/sl_pp_line.c b/src/glsl/pp/sl_pp_line.c index 41ddaf6..fc2dd89 100644 --- a/src/glsl/pp/sl_pp_line.c +++ b/src/glsl/pp/sl_pp_line.c @@ -26,6 +26,7 @@ **/ #include stdlib.h +#include string.h #include sl_pp_public.h #include sl_pp_process.h diff --git a/src/glsl/pp/sl_pp_pragma.c b/src/glsl/pp/sl_pp_pragma.c index 03269b6..489eb17 100644 --- a/src/glsl/pp/sl_pp_pragma.c +++ b/src/glsl/pp/sl_pp_pragma.c @@ -26,6 +26,7 @@ **/ #include stdlib.h +#include string.h #include sl_pp_process.h diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index 67ed588..4b783e4 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -26,7 +26,9 @@ **/ #include stdlib.h +#include string.h #include sl_pp_process.h +#include sl_pp_public.h static void diff --git a/src/glsl/pp/sl_pp_token.c b/src/glsl/pp/sl_pp_token.c index 99a32a6..f232daf 100644 --- a/src/glsl/pp/sl_pp_token.c +++ b/src/glsl/pp/sl_pp_token.c @@ -26,6 +26,7 @@ **/ #include stdlib.h +#include string.h #include sl_pp_context.h #include sl_pp_token.h diff --git a/src/glsl/pp/sl_pp_version.c b/src/glsl/pp/sl_pp_version.c index adf3017..db06523 100644 --- a/src/glsl/pp/sl_pp_version.c +++ b/src/glsl/pp/sl_pp_version.c @@ -26,6 +26,7 @@ **/ #include stdlib.h +#include string.h #include sl_pp_public.h #include sl_pp_context.h ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: Fix missing finite symbol error on Windows.
Module: Mesa Branch: master Commit: 622bdecabd73167d2f2f3aff0e223a8c64433f99 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=622bdecabd73167d2f2f3aff0e223a8c64433f99 Author: José Fonseca jfons...@vmware.com Date: Thu Sep 24 12:36:11 2009 +0100 mesa: Fix missing finite symbol error on Windows. Caused by some weird logic regarding the __WIN32__ define which made the finite definition dependent on the header include order. --- src/mesa/main/compiler.h |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 9319505..380663e 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -107,8 +107,7 @@ extern C { /** * finite macro. */ -#if defined(_WIN32) !defined(__WIN32__) !defined(__CYGWIN__) !defined(BUILD_FOR_SNAP) -# define __WIN32__ +#if defined(_MSC_VER) # define finite _finite #elif defined(__WATCOMC__) # define finite _finite ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): scons: Don't require -liberty on MinGW.
Module: Mesa Branch: master Commit: 9ea277ba7aac23c66c8879f71ff885d11c034aae URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9ea277ba7aac23c66c8879f71ff885d11c034aae Author: José Fonseca jfons...@vmware.com Date: Thu Sep 24 13:05:27 2009 +0100 scons: Don't require -liberty on MinGW. Not always present. --- scons/crossmingw.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scons/crossmingw.py b/scons/crossmingw.py index 3aed484..9cb0b89 100644 --- a/scons/crossmingw.py +++ b/scons/crossmingw.py @@ -177,7 +177,7 @@ def generate(env): # default in recent gcc versions env.AppendUnique(CFLAGS = ['-gstabs']) -env.AppendUnique(LIBS = ['iberty']) +#env.AppendUnique(LIBS = ['iberty']) env.AppendUnique(SHLINKFLAGS = ['-Wl,--enable-stdcall-fixup']) #env.AppendUnique(SHLINKFLAGS = ['-Wl,--kill-at']) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): gdi: Update for WGL state tracker interface changes.
Module: Mesa Branch: master Commit: 86962d6f6eb74cc426f57b760cc0cdcb9fec3eef URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=86962d6f6eb74cc426f57b760cc0cdcb9fec3eef Author: José Fonseca jfons...@vmware.com Date: Thu Sep 24 13:09:40 2009 +0100 gdi: Update for WGL state tracker interface changes. --- src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c | 12 src/gallium/winsys/gdi/gdi_softpipe_winsys.c | 12 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c index 9d0daf7..e8bc0f5 100644 --- a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c +++ b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c @@ -234,9 +234,9 @@ gdi_llvmpipe_context_create(struct pipe_screen *screen) static void -gdi_llvmpipe_flush_frontbuffer(struct pipe_screen *screen, - struct pipe_surface *surface, - HDC hDC) +gdi_llvmpipe_present(struct pipe_screen *screen, + struct pipe_surface *surface, + HDC hDC) { struct llvmpipe_texture *texture; struct gdi_llvmpipe_displaytarget *gdt; @@ -254,7 +254,11 @@ gdi_llvmpipe_flush_frontbuffer(struct pipe_screen *screen, static const struct stw_winsys stw_winsys = { gdi_llvmpipe_screen_create, gdi_llvmpipe_context_create, - gdi_llvmpipe_flush_frontbuffer + gdi_llvmpipe_present, + NULL, /* get_adapter_luid */ + NULL, /* shared_surface_open */ + NULL, /* shared_surface_close */ + NULL /* compose */ }; diff --git a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c index d82c8d6..5e0ccf3 100644 --- a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c +++ b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c @@ -269,9 +269,9 @@ gdi_softpipe_context_create(struct pipe_screen *screen) static void -gdi_softpipe_flush_frontbuffer(struct pipe_screen *screen, - struct pipe_surface *surface, - HDC hDC) +gdi_softpipe_present(struct pipe_screen *screen, + struct pipe_surface *surface, + HDC hDC) { struct softpipe_texture *texture; struct gdi_softpipe_buffer *buffer; @@ -304,7 +304,11 @@ gdi_softpipe_flush_frontbuffer(struct pipe_screen *screen, static const struct stw_winsys stw_winsys = { gdi_softpipe_screen_create, gdi_softpipe_context_create, - gdi_softpipe_flush_frontbuffer + gdi_softpipe_present, + NULL, /* get_adapter_luid */ + NULL, /* shared_surface_open */ + NULL, /* shared_surface_close */ + NULL /* compose */ }; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): wgl: DWM integration.
Module: Mesa Branch: master Commit: 4e5ed05b025b9b6a1a6dabba72fce3d918e77044 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4e5ed05b025b9b6a1a6dabba72fce3d918e77044 Author: José Fonseca jfons...@vmware.com Date: Thu Sep 24 13:08:34 2009 +0100 wgl: DWM integration. --- src/gallium/state_trackers/wgl/opengl32.def |1 + src/gallium/state_trackers/wgl/opengl32.mingw.def |1 + src/gallium/state_trackers/wgl/stw_device.c | 52 +++--- src/gallium/state_trackers/wgl/stw_device.h |4 + src/gallium/state_trackers/wgl/stw_framebuffer.c | 194 + src/gallium/state_trackers/wgl/stw_framebuffer.h | 16 ++ src/gallium/state_trackers/wgl/stw_icd.h | 114 - src/gallium/state_trackers/wgl/stw_pixelformat.c |7 +- src/gallium/state_trackers/wgl/stw_pixelformat.h |4 + src/gallium/state_trackers/wgl/stw_winsys.h | 54 +- 10 files changed, 380 insertions(+), 67 deletions(-) diff --git a/src/gallium/state_trackers/wgl/opengl32.def b/src/gallium/state_trackers/wgl/opengl32.def index 596417e..5daa6dd 100644 --- a/src/gallium/state_trackers/wgl/opengl32.def +++ b/src/gallium/state_trackers/wgl/opengl32.def @@ -376,6 +376,7 @@ EXPORTS DrvDescribePixelFormat DrvGetLayerPaletteEntries DrvGetProcAddress + DrvPresentBuffers DrvRealizeLayerPalette DrvReleaseContext DrvSetCallbackProcs diff --git a/src/gallium/state_trackers/wgl/opengl32.mingw.def b/src/gallium/state_trackers/wgl/opengl32.mingw.def index 1f03ea3..6ebb31a 100644 --- a/src/gallium/state_trackers/wgl/opengl32.mingw.def +++ b/src/gallium/state_trackers/wgl/opengl32.mingw.def @@ -375,6 +375,7 @@ EXPORTS DrvDescribePixelFormat = drvdescribepixelfor...@16 DrvGetLayerPaletteEntries = drvgetlayerpaletteentr...@20 DrvGetProcAddress = drvgetprocaddr...@4 + DrvPresentBuffers = drvpresentbuff...@8 DrvRealizeLayerPalette = drvrealizelayerpale...@12 DrvReleaseContext = drvreleasecont...@4 DrvSetCallbackProcs = drvsetcallbackpr...@8 diff --git a/src/gallium/state_trackers/wgl/stw_device.c b/src/gallium/state_trackers/wgl/stw_device.c index a1a5b89..985b8f0 100644 --- a/src/gallium/state_trackers/wgl/stw_device.c +++ b/src/gallium/state_trackers/wgl/stw_device.c @@ -29,6 +29,7 @@ #include glapi/glthread.h #include util/u_debug.h +#include util/u_math.h #include pipe/p_screen.h #include state_tracker/st_public.h @@ -62,38 +63,28 @@ stw_flush_frontbuffer(struct pipe_screen *screen, struct pipe_surface *surface, void *context_private ) { - const struct stw_winsys *stw_winsys = stw_dev-stw_winsys; HDC hdc = (HDC)context_private; struct stw_framebuffer *fb; fb = stw_framebuffer_from_hdc( hdc ); - /* fb can be NULL if window was destroyed already */ - if (fb) { + if (!fb) { + /* fb can be NULL if window was destroyed already */ + return; + } + #if DEBUG - { - struct pipe_surface *surface2; - - if(!st_get_framebuffer_surface( fb-stfb, ST_SURFACE_FRONT_LEFT, surface2 )) -assert(0); - else -assert(surface2 == surface); - } -#endif + { + /* ensure that a random surface was not passed to us */ + struct pipe_surface *surface2; -#ifdef DEBUG - if(stw_dev-trace_running) { - screen = trace_screen(screen)-screen; - surface = trace_surface(surface)-surface; - } -#endif - } - - stw_winsys-flush_frontbuffer(screen, surface, hdc); - - if(fb) { - stw_framebuffer_update(fb); - stw_framebuffer_release(fb); + if(!st_get_framebuffer_surface( fb-stfb, ST_SURFACE_FRONT_LEFT, surface2 )) + assert(0); + else + assert(surface2 == surface); } +#endif + + stw_framebuffer_present_locked(hdc, fb, ST_SURFACE_FRONT_LEFT); } @@ -126,6 +117,9 @@ stw_init(const struct stw_winsys *stw_winsys) if(!screen) goto error1; + if(stw_winsys-get_adapter_luid) + stw_winsys-get_adapter_luid(screen, stw_dev-AdapterLuid); + #ifdef DEBUG stw_dev-screen = trace_screen_create(screen); stw_dev-trace_running = stw_dev-screen != screen ? TRUE : FALSE; @@ -229,6 +223,14 @@ DrvSetCallbackProcs( INT nProcs, PROC *pProcs ) { + size_t size; + + if (stw_dev == NULL) + return; + + size = MIN2(nProcs * sizeof *pProcs, sizeof stw_dev-callbacks); + memcpy(stw_dev-callbacks, pProcs, size); + return; } diff --git a/src/gallium/state_trackers/wgl/stw_device.h b/src/gallium/state_trackers/wgl/stw_device.h index 5e4e3d6..0bf3b0d 100644 --- a/src/gallium/state_trackers/wgl/stw_device.h +++ b/src/gallium/state_trackers/wgl/stw_device.h @@ -52,10 +52,14 @@ struct stw_device boolean trace_running; #endif + LUID AdapterLuid; + struct stw_pixelformat_info pixelformats[STW_MAX_PIXELFORMATS]; unsigned
Mesa (mesa_7_6_branch): r600: don't setup hardware state if TFP
Module: Mesa Branch: mesa_7_6_branch Commit: b1e417413f2da8aad1872fa009949da101156431 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b1e417413f2da8aad1872fa009949da101156431 Author: Dave Airlie airl...@linux.ie Date: Wed Sep 9 15:02:16 2009 +1000 r600: don't setup hardware state if TFP if we have a BO here it means TFP and we should have set it up already. tested by b0le on #radeon --- src/mesa/drivers/dri/r600/r600_texstate.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index 49b603b..6436a5d 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -565,6 +565,10 @@ static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *tex int firstlevel = t-mt ? t-mt-firstLevel : 0; GLuint uTexelPitch, row_align; + if ( t-bo ) { + return GL_TRUE; + } + firstImage = t-base.Image[0][firstlevel]; if (!t-image_override) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): r600: fix dri2 clipping
Module: Mesa Branch: mesa_7_6_branch Commit: cbab3d7f2a77f187fb688593c17396d4967c75b5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cbab3d7f2a77f187fb688593c17396d4967c75b5 Author: Alex Deucher alexdeuc...@gmail.com Date: Tue Sep 8 16:03:25 2009 -0400 r600: fix dri2 clipping --- src/mesa/drivers/dri/r600/r700_state.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 1f4724e..2a0b419 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -1272,8 +1272,8 @@ void r700SetScissor(context_t *context) //--- if (context-radeon.radeonScreen-driScreen-dri2.enabled) { x1 = 0; y1 = 0; - x2 = rrb-base.Width - 1; - y2 = rrb-base.Height - 1; + x2 = rrb-base.Width; + y2 = rrb-base.Height; } else { x1 = rrb-dPriv-x; y1 = rrb-dPriv-y; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): r600: fix ftp for dri1
Module: Mesa Branch: mesa_7_6_branch Commit: 65b01d449cc594e1c7e1a44c5d87fdc698300e9a URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=65b01d449cc594e1c7e1a44c5d87fdc698300e9a Author: Alex Deucher alexdeuc...@gmail.com Date: Wed Sep 9 01:41:46 2009 -0400 r600: fix ftp for dri1 We use t-bo for dri1 since r600 uses CS for dri1. --- src/mesa/drivers/dri/r600/r600_texstate.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index 6436a5d..f30dd11 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -565,9 +565,10 @@ static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *tex int firstlevel = t-mt ? t-mt-firstLevel : 0; GLuint uTexelPitch, row_align; - if ( t-bo ) { - return GL_TRUE; - } + if (rmesa-radeon.radeonScreen-driScreen-dri2.enabled + t-image_override + t-bo) + return; firstImage = t-base.Image[0][firstlevel]; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): r600: check if textures are actually enabled before submission
Module: Mesa Branch: mesa_7_6_branch Commit: 6552a103f903a2b767464cd2d267f706a6baf7d5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6552a103f903a2b767464cd2d267f706a6baf7d5 Author: Alex Deucher alexdeuc...@gmail.com Date: Wed Sep 9 11:14:17 2009 -0400 r600: check if textures are actually enabled before submission noticed by taiu on IRC. --- src/mesa/drivers/dri/r600/r600_texstate.c |2 +- src/mesa/drivers/dri/r600/r700_chip.c | 118 +++- 2 files changed, 64 insertions(+), 56 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index f30dd11..bcb8d7c 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -69,7 +69,7 @@ void r600UpdateTextureState(GLcontext * ctx) for (unit = 0; unit R700_MAX_TEXTURE_UNITS; unit++) { texUnit = ctx-Texture.Unit[unit]; t = radeon_tex_obj(ctx-Texture.Unit[unit]._Current); - + r700-textures[unit] = NULL; if (texUnit-_ReallyEnabled) { if (!t) continue; diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 37bff56..312cacf 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -52,38 +52,40 @@ static void r700SendTexState(GLcontext *ctx, struct radeon_state_atom *atom) radeon_print(RADEON_STATE, RADEON_VERBOSE, %s\n, __func__); for (i = 0; i R700_TEXTURE_NUMBERUNITS; i++) { - radeonTexObj *t = r700-textures[i]; - if (t) { - if (!t-image_override) - bo = t-mt-bo; - else - bo = t-bo; - if (bo) { - - r700SyncSurf(context, bo, - RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, -0, TC_ACTION_ENA_bit); - - BEGIN_BATCH_NO_AUTOSTATE(9 + 4); - R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_RESOURCE, 7)); - R600_OUT_BATCH(i * 7); - R600_OUT_BATCH(r700-textures[i]-SQ_TEX_RESOURCE0); - R600_OUT_BATCH(r700-textures[i]-SQ_TEX_RESOURCE1); - R600_OUT_BATCH(r700-textures[i]-SQ_TEX_RESOURCE2); - R600_OUT_BATCH(r700-textures[i]-SQ_TEX_RESOURCE3); - R600_OUT_BATCH(r700-textures[i]-SQ_TEX_RESOURCE4); - R600_OUT_BATCH(r700-textures[i]-SQ_TEX_RESOURCE5); - R600_OUT_BATCH(r700-textures[i]-SQ_TEX_RESOURCE6); - R600_OUT_BATCH_RELOC(r700-textures[i]-SQ_TEX_RESOURCE2, -bo, -0, - RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0); - R600_OUT_BATCH_RELOC(r700-textures[i]-SQ_TEX_RESOURCE3, -bo, - r700-textures[i]-SQ_TEX_RESOURCE3, - RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0); - END_BATCH(); - COMMIT_BATCH(); + if (ctx-Texture.Unit[i]._ReallyEnabled) { + radeonTexObj *t = r700-textures[i]; + if (t) { + if (!t-image_override) + bo = t-mt-bo; + else + bo = t-bo; + if (bo) { + + r700SyncSurf(context, bo, + RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, +0, TC_ACTION_ENA_bit); + + BEGIN_BATCH_NO_AUTOSTATE(9 + 4); + R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_RESOURCE, 7)); + R600_OUT_BATCH(i * 7); + R600_OUT_BATCH(r700-textures[i]-SQ_TEX_RESOURCE0); + R600_OUT_BATCH(r700-textures[i]-SQ_TEX_RESOURCE1); + R600_OUT_BATCH(r700-textures[i]-SQ_TEX_RESOURCE2); + R600_OUT_BATCH(r700-textures[i]-SQ_TEX_RESOURCE3); + R600_OUT_BATCH(r700-textures[i]-SQ_TEX_RESOURCE4); +
Mesa (mesa_7_6_branch): r600: enable caching of vertex programs
Module: Mesa Branch: mesa_7_6_branch Commit: 9edd1a441c3c0c3f018ae561cd5711398ca56f95 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9edd1a441c3c0c3f018ae561cd5711398ca56f95 Author: Andre Maasikas amaasi...@gmail.com Date: Fri Sep 11 10:59:05 2009 -0400 r600: enable caching of vertex programs --- src/mesa/drivers/dri/r600/r600_context.h |3 + src/mesa/drivers/dri/r600/r700_chip.c | 10 +-- src/mesa/drivers/dri/r600/r700_oglprog.c | 36 +- src/mesa/drivers/dri/r600/r700_render.c |9 ++- src/mesa/drivers/dri/r600/r700_vertprog.c | 103 +++- src/mesa/drivers/dri/r600/r700_vertprog.h | 11 +++- 6 files changed, 110 insertions(+), 62 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r600_context.h b/src/mesa/drivers/dri/r600/r600_context.h index 8ae05a3..c59df75 100644 --- a/src/mesa/drivers/dri/r600/r600_context.h +++ b/src/mesa/drivers/dri/r600/r600_context.h @@ -51,6 +51,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include r700_chip.h #include r600_tex.h #include r700_oglprog.h +#include r700_vertprog.h struct r600_context; typedef struct r600_context context_t; @@ -155,6 +156,8 @@ struct r600_context { struct r600_hw_state atoms; + struct r700_vertex_program *selected_vp; + /* Vertex buffers */ GLvector4f dummy_attrib[_TNL_ATTRIB_MAX]; diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 312cacf..1b56059 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -211,8 +211,7 @@ static void r700SetupVTXConstants(GLcontext * ctx, void r700SetupStreams(GLcontext *ctx) { context_t *context = R700_CONTEXT(ctx); - struct r700_vertex_program *vpc - = (struct r700_vertex_program *)ctx-VertexProgram._Current; +struct r700_vertex_program *vp = context-selected_vp; TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *vb = tnl-vb; unsigned int i, j = 0; @@ -221,7 +220,7 @@ void r700SetupStreams(GLcontext *ctx) R600_STATECHANGE(context, vtx); for(i=0; iVERT_ATTRIB_MAX; i++) { - if(vpc-mesa_program.Base.InputsRead (1 i)) { + if(vp-mesa_program-Base.InputsRead (1 i)) { rcommon_emit_vector(ctx, context-radeon.tcl.aos[j], vb-AttribPtr[i]-data, @@ -237,8 +236,7 @@ void r700SetupStreams(GLcontext *ctx) static void r700SendVTXState(GLcontext *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); -struct r700_vertex_program *vpc - = (struct r700_vertex_program *)ctx-VertexProgram._Current; +struct r700_vertex_program *vp = context-selected_vp; unsigned int i, j = 0; BATCH_LOCALS(context-radeon); radeon_print(RADEON_STATE, RADEON_VERBOSE, %s\n, __func__); @@ -258,7 +256,7 @@ static void r700SendVTXState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); for(i=0; iVERT_ATTRIB_MAX; i++) { - if(vpc-mesa_program.Base.InputsRead (1 i)) { + if(vp-mesa_program-Base.InputsRead (1 i)) { /* currently aos are packed */ r700SetupVTXConstants(ctx, i, diff --git a/src/mesa/drivers/dri/r600/r700_oglprog.c b/src/mesa/drivers/dri/r600/r700_oglprog.c index 3c8c1fd..5290ef3 100644 --- a/src/mesa/drivers/dri/r600/r700_oglprog.c +++ b/src/mesa/drivers/dri/r600/r700_oglprog.c @@ -46,7 +46,7 @@ static struct gl_program *r700NewProgram(GLcontext * ctx, { struct gl_program *pProgram = NULL; -struct r700_vertex_program *vp; +struct r700_vertex_program_cont *vpc; struct r700_fragment_program *fp; radeon_print(RADEON_SHADER, RADEON_VERBOSE, @@ -56,16 +56,11 @@ static struct gl_program *r700NewProgram(GLcontext * ctx, { case GL_VERTEX_STATE_PROGRAM_NV: case GL_VERTEX_PROGRAM_ARB: -vp = CALLOC_STRUCT(r700_vertex_program); +vpc = CALLOC_STRUCT(r700_vertex_program_cont); pProgram = _mesa_init_vertex_program(ctx, - vp-mesa_program, + vpc-mesa_program, target, id); -vp-translated = GL_FALSE; -vp-loaded = GL_FALSE; - -vp-shaderbo = NULL; - break; case GL_FRAGMENT_PROGRAM_NV: case GL_FRAGMENT_PROGRAM_ARB: @@ -89,7 +84,8 @@ static struct gl_program *r700NewProgram(GLcontext * ctx, static void r700DeleteProgram(GLcontext * ctx, struct gl_program *prog) { -struct r700_vertex_program * vp; +struct r700_vertex_program_cont * vpc; +struct r700_vertex_program *vp, *tmp;
Mesa (mesa_7_6_branch): r600: fix warning
Module: Mesa Branch: mesa_7_6_branch Commit: 93a7ea6ba0d5700e18b28c23da226e055f7c2fa1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=93a7ea6ba0d5700e18b28c23da226e055f7c2fa1 Author: Alex Deucher alexdeuc...@gmail.com Date: Mon Sep 14 17:08:26 2009 -0400 r600: fix warning Noticed by rnoland on IRC. --- src/mesa/drivers/dri/r600/r700_assembler.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index fda6692..efeccb2 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -3387,6 +3387,7 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) break; case PROGRAM_TEMPORARY: case PROGRAM_INPUT: +default: src_const = GL_FALSE; break; } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): r600: support position_invariant programs
Module: Mesa Branch: mesa_7_6_branch Commit: 2cd2dc34ac93dd929ec8f01cf1f7f8dfa6b34d0d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2cd2dc34ac93dd929ec8f01cf1f7f8dfa6b34d0d Author: Andre Maasikas amaasi...@gmail.com Date: Tue Sep 15 11:27:51 2009 -0400 r600: support position_invariant programs --- src/mesa/drivers/dri/r600/r700_vertprog.c | 30 +--- 1 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index 8c2b007..9ee2628 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -42,6 +42,7 @@ #include radeon_debug.h #include r600_context.h #include r600_cmdbuf.h +#include shader/programopt.c #include r700_debug.h #include r700_vertprog.h @@ -272,6 +273,11 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, vp = _mesa_calloc(sizeof(*vp)); vp-mesa_program = (struct gl_vertex_program *)_mesa_clone_program(ctx, mesa_vp-Base); + if (mesa_vp-IsPositionInvariant) + { +_mesa_insert_mvp_code(ctx, vp-mesa_program); +} + for(i=0; iVERT_ATTRIB_MAX; i++) { unBit = 1 i; @@ -290,21 +296,21 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, //Init_Program Init_r700_AssemblerBase(SPT_VP, (vp-r700AsmCode), (vp-r700Shader) ); - Map_Vertex_Program( vp, mesa_vp ); + Map_Vertex_Program( vp, vp-mesa_program ); - if(GL_FALSE == Find_Instruction_Dependencies_vp(vp, mesa_vp)) + if(GL_FALSE == Find_Instruction_Dependencies_vp(vp, vp-mesa_program)) { return NULL; } - if(GL_FALSE == AssembleInstr(mesa_vp-Base.NumInstructions, - (mesa_vp-Base.Instructions[0]), + if(GL_FALSE == AssembleInstr(vp-mesa_program-Base.NumInstructions, + (vp-mesa_program-Base.Instructions[0]), (vp-r700AsmCode)) ) { return NULL; } -if(GL_FALSE == Process_Vertex_Exports((vp-r700AsmCode), mesa_vp-Base.OutputsWritten) ) +if(GL_FALSE == Process_Vertex_Exports((vp-r700AsmCode), vp-mesa_program-Base.OutputsWritten) ) { return NULL; } @@ -329,23 +335,23 @@ void r700SelectVertexShader(GLcontext *ctx) unsigned int unBit; unsigned int i; GLboolean match; +GLbitfield InputsRead; vpc = (struct r700_vertex_program_cont *)ctx-VertexProgram._Current; -#if 0 -if (context-radeon.NewGLState (_NEW_PROGRAM_CONSTANTS|_NEW_PROGRAM)) +InputsRead = vpc-mesa_program.Base.InputsRead; +if (vpc-mesa_program.IsPositionInvariant) { - vpc-needUpdateVF = 1; -} -#endif - + InputsRead |= VERT_BIT_POS; +} + for (vp = vpc-progs; vp; vp = vp-next) { match = GL_TRUE; for(i=0; iVERT_ATTRIB_MAX; i++) { unBit = 1 i; -if(vpc-mesa_program.Base.InputsRead unBit) + if(InputsRead unBit) { if (vp-aos_desc[i].size != vb-AttribPtr[i]-size) match = GL_FALSE; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): r600: add span support for 1D tiles
Module: Mesa Branch: mesa_7_6_branch Commit: 9437ac9bccd294bd5a8b838e7ca7597e5dc6d5b0 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9437ac9bccd294bd5a8b838e7ca7597e5dc6d5b0 Author: Alex Deucher alexdeuc...@gmail.com Date: Mon Sep 14 18:05:15 2009 -0400 r600: add span support for 1D tiles 1D tile span support for depth/stencil/color/textures Z and stencil buffers are always tiled, so this fixes sw access to Z and stencil buffers. color and textures are currently linear, but this adds span support when we implement 1D tiling. This fixes the text in progs/demos/engine and progs/tests/z* --- src/mesa/drivers/dri/r600/r600_reg_auto_r6xx.h |2 + src/mesa/drivers/dri/r600/r700_chip.c |2 +- src/mesa/drivers/dri/radeon/radeon_span.c | 220 3 files changed, 223 insertions(+), 1 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r600_reg_auto_r6xx.h b/src/mesa/drivers/dri/r600/r600_reg_auto_r6xx.h index 9d5aa3c..edd85b0 100644 --- a/src/mesa/drivers/dri/r600/r600_reg_auto_r6xx.h +++ b/src/mesa/drivers/dri/r600/r600_reg_auto_r6xx.h @@ -1366,6 +1366,7 @@ enum { DB_DEPTH_INFO__READ_SIZE_bit = 1 3, DB_DEPTH_INFO__ARRAY_MODE_mask= 0x0f 15, DB_DEPTH_INFO__ARRAY_MODE_shift = 15, + ARRAY_1D_TILED_THIN1 = 0x02, ARRAY_2D_TILED_THIN1 = 0x04, TILE_SURFACE_ENABLE_bit = 1 25, TILE_COMPACT_bit = 1 26, @@ -1449,6 +1450,7 @@ enum { CB_COLOR0_INFO__ARRAY_MODE_shift = 8, ARRAY_LINEAR_GENERAL = 0x00, ARRAY_LINEAR_ALIGNED = 0x01, +/* ARRAY_1D_TILED_THIN1 = 0x02, */ /* ARRAY_2D_TILED_THIN1 = 0x04, */ NUMBER_TYPE_mask = 0x07 12, NUMBER_TYPE_shift = 12, diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 1b56059..06d7e9c 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -351,7 +351,7 @@ static void r700SetDepthTarget(context_t *context) SETfield(r700-DB_DEPTH_INFO.u32All, DEPTH_16, DB_DEPTH_INFO__FORMAT_shift, DB_DEPTH_INFO__FORMAT_mask); } -SETfield(r700-DB_DEPTH_INFO.u32All, ARRAY_2D_TILED_THIN1, +SETfield(r700-DB_DEPTH_INFO.u32All, ARRAY_1D_TILED_THIN1, DB_DEPTH_INFO__ARRAY_MODE_shift, DB_DEPTH_INFO__ARRAY_MODE_mask); /* r700-DB_PREFETCH_LIMIT.bits.DEPTH_HEIGHT_TILE_MAX = (context-currentDraw-h 3) - 1; */ /* z buffer sie may much bigger than what need, so use actual used h. */ } diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 4e100d8..aa20353 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -106,6 +106,142 @@ static GLubyte *r200_depth_4byte(const struct radeon_renderbuffer * rrb, } #endif +/* r600 tiling + * two main types: + * - 1D (akin to macro-linear/micro-tiled on older asics) + * - 2D (akin to macro-tiled/micro-tiled on older asics) + * only 1D tiling is implemented below + */ +#if defined(RADEON_COMMON_FOR_R600) +static GLint r600_1d_tile_helper(const struct radeon_renderbuffer * rrb, +GLint x, GLint y, GLint is_depth, GLint is_stencil) +{ +GLint element_bytes = rrb-cpp; +GLint num_samples = 1; +GLint tile_width = 8; +GLint tile_height = 8; +GLint tile_thickness = 1; +GLint pitch_elements = rrb-pitch / element_bytes; +GLint height = rrb-base.Height; +GLint z = 0; +GLint sample_number = 0; +/* */ +GLint tile_bytes; +GLint tiles_per_row; +GLint tiles_per_slice; +GLint slice_offset; +GLint tile_row_index; +GLint tile_column_index; +GLint tile_offset; +GLint pixel_number = 0; +GLint element_offset; +GLint offset = 0; + +tile_bytes = tile_width * tile_height * tile_thickness * element_bytes * num_samples; +tiles_per_row = pitch_elements /tile_width; +tiles_per_slice = tiles_per_row * (height / tile_height); +slice_offset = (z / tile_thickness) * tiles_per_slice * tile_bytes; +tile_row_index = y / tile_height; +tile_column_index = x / tile_width; +tile_offset = ((tile_row_index * tiles_per_row) + tile_column_index) * tile_bytes; + +if (is_depth) { + GLint pixel_offset = 0; + + pixel_number |= ((x 0) 1) 0; // pn[0] = x[0] + pixel_number |= ((y 0) 1) 1; // pn[1] = y[0] + pixel_number |= ((x 1) 1) 2; // pn[2] = x[1] + pixel_number |= ((y 1) 1) 3; // pn[3] = y[1] + pixel_number |= ((x 2) 1) 4; //
Mesa (mesa_7_6_branch): radeon: don't build non-r600 span code on r600
Module: Mesa Branch: mesa_7_6_branch Commit: ec14d59afa952b4e53ad268971098584686a6fca URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ec14d59afa952b4e53ad268971098584686a6fca Author: Alex Deucher alexdeuc...@gmail.com Date: Tue Sep 15 17:12:03 2009 -0400 radeon: don't build non-r600 span code on r600 --- src/mesa/drivers/dri/radeon/radeon_span.c |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 9959da0..d603f52 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -239,7 +239,7 @@ static GLubyte *r600_ptr_color(const struct radeon_renderbuffer * rrb, return ptr[offset]; } -#endif +#else /* radeon tiling on r300-r500 has 4 states, macro-linear/micro-linear @@ -332,7 +332,10 @@ static GLubyte *radeon_ptr_2byte_8x2(const struct radeon_renderbuffer * rrb, return ptr[offset]; } +#endif + #ifndef COMPILE_R300 +#ifndef COMPILE_R600 static uint32_t z24s8_to_s8z24(uint32_t val) { @@ -345,6 +348,7 @@ s8z24_to_z24s8(uint32_t val) return (val 24) | (val 8); } #endif +#endif /* * Note that all information needed to access pixels in a renderbuffer ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): r600: minor span cleanups
Module: Mesa Branch: mesa_7_6_branch Commit: dbec27be856584bc5205c7eeeca2b7e98299d4cb URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dbec27be856584bc5205c7eeeca2b7e98299d4cb Author: Alex Deucher alexdeuc...@gmail.com Date: Tue Sep 15 16:58:37 2009 -0400 r600: minor span cleanups --- src/mesa/drivers/dri/radeon/radeon_span.c |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index aa20353..9959da0 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -113,8 +113,8 @@ static GLubyte *r200_depth_4byte(const struct radeon_renderbuffer * rrb, * only 1D tiling is implemented below */ #if defined(RADEON_COMMON_FOR_R600) -static GLint r600_1d_tile_helper(const struct radeon_renderbuffer * rrb, -GLint x, GLint y, GLint is_depth, GLint is_stencil) +static inline GLint r600_1d_tile_helper(const struct radeon_renderbuffer * rrb, + GLint x, GLint y, GLint is_depth, GLint is_stencil) { GLint element_bytes = rrb-cpp; GLint num_samples = 1; @@ -138,7 +138,7 @@ static GLint r600_1d_tile_helper(const struct radeon_renderbuffer * rrb, GLint offset = 0; tile_bytes = tile_width * tile_height * tile_thickness * element_bytes * num_samples; -tiles_per_row = pitch_elements /tile_width; +tiles_per_row = pitch_elements / tile_width; tiles_per_slice = tiles_per_row * (height / tile_height); slice_offset = (z / tile_thickness) * tiles_per_slice * tile_bytes; tile_row_index = y / tile_height; @@ -157,7 +157,6 @@ static GLint r600_1d_tile_helper(const struct radeon_renderbuffer * rrb, switch (element_bytes) { case 2: pixel_offset = pixel_number * element_bytes * num_samples; - element_offset = pixel_offset + (sample_number * element_bytes); break; case 4: /* stencil and depth data are stored separately within a tile. ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): r600: fix polygon offset
Module: Mesa Branch: mesa_7_6_branch Commit: 095db818c6c7ed5706b5f31d17d0cb19c03cb67a URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=095db818c6c7ed5706b5f31d17d0cb19c03cb67a Author: Alex Deucher alexdeuc...@gmail.com Date: Sat Sep 19 14:46:06 2009 -0400 r600: fix polygon offset --- src/mesa/drivers/dri/r600/r700_state.c | 11 --- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 2a0b419..d8190ef 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -1122,20 +1122,25 @@ static void r700PolygonOffset(GLcontext * ctx, GLfloat factor, GLfloat units) // context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(context-hw); GLfloat constant = units; + GLchar depth = 0; + + R600_STATECHANGE(context, poly); switch (ctx-Visual.depthBits) { case 16: constant *= 4.0; + depth = -16; break; case 24: constant *= 2.0; + depth = -24; break; } factor *= 12.0; - - R600_STATECHANGE(context, poly); - + SETfield(r700-PA_SU_POLY_OFFSET_DB_FMT_CNTL.u32All, depth, +POLY_OFFSET_NEG_NUM_DB_BITS_shift, POLY_OFFSET_NEG_NUM_DB_BITS_mask); + //r700-PA_SU_POLY_OFFSET_CLAMP.f32All = constant; //??? r700-PA_SU_POLY_OFFSET_FRONT_SCALE.f32All = factor; r700-PA_SU_POLY_OFFSET_FRONT_OFFSET.f32All = constant; r700-PA_SU_POLY_OFFSET_BACK_SCALE.f32All = factor; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): r600: fix point sizes
Module: Mesa Branch: mesa_7_6_branch Commit: 48559c76056e09ca4f9e4f39e9008f6d32ecd5b0 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=48559c76056e09ca4f9e4f39e9008f6d32ecd5b0 Author: Alex Deucher alexdeuc...@gmail.com Date: Sat Sep 19 15:18:42 2009 -0400 r600: fix point sizes registers takes radius --- src/mesa/drivers/dri/r600/r700_state.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index d8190ef..8571563 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -837,9 +837,9 @@ static void r700PointSize(GLcontext * ctx, GLfloat size) size = CLAMP(size, ctx-Const.MinPointSize, ctx-Const.MaxPointSize); /* format is 12.4 fixed point */ - SETfield(r700-PA_SU_POINT_SIZE.u32All, (int)(size * 16), + SETfield(r700-PA_SU_POINT_SIZE.u32All, (int)(size * 8.0), PA_SU_POINT_SIZE__HEIGHT_shift, PA_SU_POINT_SIZE__HEIGHT_mask); - SETfield(r700-PA_SU_POINT_SIZE.u32All, (int)(size * 16), + SETfield(r700-PA_SU_POINT_SIZE.u32All, (int)(size * 8.0), PA_SU_POINT_SIZE__WIDTH_shift, PA_SU_POINT_SIZE__WIDTH_mask); } @@ -854,11 +854,11 @@ static void r700PointParameter(GLcontext * ctx, GLenum pname, const GLfloat * pa /* format is 12.4 fixed point */ switch (pname) { case GL_POINT_SIZE_MIN: - SETfield(r700-PA_SU_POINT_MINMAX.u32All, (int)(ctx-Point.MinSize * 16.0), + SETfield(r700-PA_SU_POINT_MINMAX.u32All, (int)(ctx-Point.MinSize * 8.0), MIN_SIZE_shift, MIN_SIZE_mask); break; case GL_POINT_SIZE_MAX: - SETfield(r700-PA_SU_POINT_MINMAX.u32All, (int)(ctx-Point.MaxSize * 16.0), + SETfield(r700-PA_SU_POINT_MINMAX.u32All, (int)(ctx-Point.MaxSize * 8.0), MAX_SIZE_shift, MAX_SIZE_mask); break; case GL_POINT_DISTANCE_ATTENUATION: ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): r600: fix some issues with LIT instruction
Module: Mesa Branch: mesa_7_6_branch Commit: ed91d103477d563f73be3555d1022ec9af073467 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ed91d103477d563f73be3555d1022ec9af073467 Author: Andre Maasikas amaasi...@gmail.com Date: Mon Sep 21 10:14:25 2009 -0400 r600: fix some issues with LIT instruction - MUL_LIT is ALU.Trans instruction - some Trans instructions can take 3 arguments - don't clobber dst.x, use dst.z as temp, it'll get written correct value in last insn - respect source swizzles --- src/mesa/drivers/dri/r600/r700_assembler.c | 69 ++- 1 files changed, 36 insertions(+), 33 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index efeccb2..f46bc32 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -2024,7 +2024,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) return GL_FALSE; } -if (pAsm-D.dst.math == 0) +if (uNumSrc 1) { // Process source 1 current_source_index = 1; @@ -2880,6 +2880,11 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) return GL_FALSE; } +if( GL_FALSE == assemble_src(pAsm, 0, -1) ) +{ +return GL_FALSE; +} + /* dst.y = max(src.x, 0.0) */ pAsm-D.dst.opcode = SQ_OP2_INST_MAX; pAsm-D.dst.rtype= dstType; @@ -2891,11 +2896,6 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) pAsm-S[0].src.rtype = srcType; pAsm-S[0].src.reg = srcReg; setaddrmode_PVSSRC((pAsm-S[0].src), ADDR_ABSOLUTE); -noneg_PVSSRC((pAsm-S[0].src)); -pAsm-S[0].src.swizzlex = SQ_SEL_X; -pAsm-S[0].src.swizzley = SQ_SEL_X; -pAsm-S[0].src.swizzlez = SQ_SEL_X; -pAsm-S[0].src.swizzlew = SQ_SEL_X; pAsm-S[1].src.rtype = SRC_REG_TEMPORARY; pAsm-S[1].src.reg = tmp; setaddrmode_PVSSRC((pAsm-S[1].src), ADDR_ABSOLUTE); @@ -2909,34 +2909,47 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) return GL_FALSE; } -/* before: dst.w = log(src.y) - * after : dst.x = log(src.y) - * why change dest register is that dst.w has been initialized as 1 before - */ +if( GL_FALSE == assemble_src(pAsm, 0, -1) ) +{ +return GL_FALSE; +} + +swizzleagain_PVSSRC((pAsm-S[0].src), SQ_SEL_Y, SQ_SEL_Y, SQ_SEL_Y, SQ_SEL_Y); + +/* dst.z = log(src.y) */ pAsm-D.dst.opcode = SQ_OP2_INST_LOG_CLAMPED; pAsm-D.dst.math = 1; pAsm-D.dst.rtype= dstType; pAsm-D.dst.reg = dstReg; -pAsm-D.dst.writex = 1; +pAsm-D.dst.writex = 0; pAsm-D.dst.writey = 0; -pAsm-D.dst.writez = 0; +pAsm-D.dst.writez = 1; pAsm-D.dst.writew = 0; pAsm-S[0].src.rtype = srcType; pAsm-S[0].src.reg = srcReg; setaddrmode_PVSSRC((pAsm-S[0].src), ADDR_ABSOLUTE); -noneg_PVSSRC((pAsm-S[0].src)); -pAsm-S[0].src.swizzlex = SQ_SEL_Y; -pAsm-S[0].src.swizzley = SQ_SEL_Y; -pAsm-S[0].src.swizzlez = SQ_SEL_Y; -pAsm-S[0].src.swizzlew = SQ_SEL_Y; if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } -/* before: tmp.x = amd MUL_LIT(src.w, dst.w, src.x ) */ -/* after : tmp.x = amd MUL_LIT(src.w, dst.x, src.x ) */ +if( GL_FALSE == assemble_src(pAsm, 0, -1) ) +{ +return GL_FALSE; +} + +if( GL_FALSE == assemble_src(pAsm, 0, 2) ) +{ +return GL_FALSE; +} + +swizzleagain_PVSSRC((pAsm-S[0].src), SQ_SEL_W, SQ_SEL_W, SQ_SEL_W, SQ_SEL_W); + +swizzleagain_PVSSRC((pAsm-S[2].src), SQ_SEL_X, SQ_SEL_X, SQ_SEL_X, SQ_SEL_X); + +/* tmp.x = amd MUL_LIT(src.w, dst.z, src.x ) */ pAsm-D.dst.opcode = SQ_OP3_INST_MUL_LIT; +pAsm-D.dst.math = 1; pAsm-D.dst.op3 = 1; pAsm-D.dst.rtype= DST_REG_TEMPORARY; pAsm-D.dst.reg = tmp; @@ -2948,29 +2961,19 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) pAsm-S[0].src.rtype = srcType; pAsm-S[0].src.reg = srcReg; setaddrmode_PVSSRC((pAsm-S[0].src), ADDR_ABSOLUTE); -noneg_PVSSRC((pAsm-S[0].src)); -pAsm-S[0].src.swizzlex = SQ_SEL_W; -pAsm-S[0].src.swizzley = SQ_SEL_W; -pAsm-S[0].src.swizzlez = SQ_SEL_W; -pAsm-S[0].src.swizzlew = SQ_SEL_W; pAsm-S[1].src.rtype = SRC_REG_TEMPORARY; pAsm-S[1].src.reg = dstReg; setaddrmode_PVSSRC((pAsm-S[1].src), ADDR_ABSOLUTE); noneg_PVSSRC((pAsm-S[1].src)); -pAsm-S[1].src.swizzlex = SQ_SEL_X; -pAsm-S[1].src.swizzley = SQ_SEL_X; -pAsm-S[1].src.swizzlez = SQ_SEL_X; -pAsm-S[1].src.swizzlew = SQ_SEL_X; +pAsm-S[1].src.swizzlex = SQ_SEL_Z; +pAsm-S[1].src.swizzley = SQ_SEL_Z; +pAsm-S[1].src.swizzlez = SQ_SEL_Z; +pAsm-S[1].src.swizzlew = SQ_SEL_Z; pAsm-S[2].src.rtype = srcType; pAsm-S[2].src.reg = srcReg; setaddrmode_PVSSRC((pAsm-S[2].src), ADDR_ABSOLUTE); -
Mesa (mesa_7_6_branch): r600: various cleanups
Module: Mesa Branch: mesa_7_6_branch Commit: 28308c92605229129a12a2273dda47c6a2ca4790 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=28308c92605229129a12a2273dda47c6a2ca4790 Author: Alex Deucher alexdeuc...@gmail.com Date: Mon Sep 21 16:30:14 2009 -0400 r600: various cleanups - max texture size is 8k, but mesa doesn't support that at the moment. - attempt to set shader limits to what the hw actually supports - clean up some old r300 cruft - no need to explicitly disable irqs. This is fixed in the drm now. Signed-off-by: Alex Deucher alexdeuc...@gmail.com --- src/mesa/drivers/dri/r600/r600_context.c | 43 ++-- src/mesa/drivers/dri/r600/r600_context.h | 19 - .../drivers/dri/radeon/radeon_common_context.c |7 +-- 3 files changed, 24 insertions(+), 45 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 251c124..414c5ae 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -281,8 +281,8 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, ctx-Const.MaxTextureMaxAnisotropy = 16.0; ctx-Const.MaxTextureLodBias = 16.0; - ctx-Const.MaxTextureLevels = 13; - ctx-Const.MaxTextureRectSize = 4096; + ctx-Const.MaxTextureLevels = 13; /* hw support 14 */ + ctx-Const.MaxTextureRectSize = 4096; /* hw support 8192 */ ctx-Const.MinPointSize = 0x0001 / 8.0; ctx-Const.MinPointSizeAA = 0x0001 / 8.0; @@ -328,25 +328,26 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, _tnl_allow_vertex_fog(ctx, GL_TRUE); /* currently bogus data */ - ctx-Const.VertexProgram.MaxInstructions = VSF_MAX_FRAGMENT_LENGTH / 4; - ctx-Const.VertexProgram.MaxNativeInstructions = - VSF_MAX_FRAGMENT_LENGTH / 4; - ctx-Const.VertexProgram.MaxNativeAttribs = 16; /* r420 */ - ctx-Const.VertexProgram.MaxTemps = 32; - ctx-Const.VertexProgram.MaxNativeTemps = - /*VSF_MAX_FRAGMENT_TEMPS */ 32; - ctx-Const.VertexProgram.MaxNativeParameters = 256; /* r420 */ - ctx-Const.VertexProgram.MaxNativeAddressRegs = 1; - - ctx-Const.FragmentProgram.MaxNativeTemps = PFS_NUM_TEMP_REGS; - ctx-Const.FragmentProgram.MaxNativeAttribs = 11; /* copy i915... */ - ctx-Const.FragmentProgram.MaxNativeParameters = PFS_NUM_CONST_REGS; - ctx-Const.FragmentProgram.MaxNativeAluInstructions = PFS_MAX_ALU_INST; - ctx-Const.FragmentProgram.MaxNativeTexInstructions = PFS_MAX_TEX_INST; - ctx-Const.FragmentProgram.MaxNativeInstructions = - PFS_MAX_ALU_INST + PFS_MAX_TEX_INST; - ctx-Const.FragmentProgram.MaxNativeTexIndirections = - PFS_MAX_TEX_INDIRECT; + ctx-Const.VertexProgram.MaxInstructions = 8192; /* in theory no limit */ + ctx-Const.VertexProgram.MaxNativeInstructions = 8192; + ctx-Const.VertexProgram.MaxNativeAttribs = 160; + ctx-Const.VertexProgram.MaxTemps = 256; /* 256 for reg-based constants, inline consts also supported */ + ctx-Const.VertexProgram.MaxNativeTemps = 256; + ctx-Const.VertexProgram.MaxNativeParameters = 256; /* ??? */ + ctx-Const.VertexProgram.MaxNativeAddressRegs = 1; /* ??? */ + + ctx-Const.FragmentProgram.MaxNativeTemps = 256; + ctx-Const.FragmentProgram.MaxNativeAttribs = 32; + ctx-Const.FragmentProgram.MaxNativeParameters = 256; + ctx-Const.FragmentProgram.MaxNativeAluInstructions = 8192; + /* 8 per clause on r6xx, 16 on rv670/r7xx */ + if ((screen-chip_family == CHIP_FAMILY_RV670) || + (screen-chip_family = CHIP_FAMILY_RV770)) + ctx-Const.FragmentProgram.MaxNativeTexInstructions = 16; + else + ctx-Const.FragmentProgram.MaxNativeTexInstructions = 8; + ctx-Const.FragmentProgram.MaxNativeInstructions = 8192; + ctx-Const.FragmentProgram.MaxNativeTexIndirections = 8; /* ??? */ ctx-Const.FragmentProgram.MaxNativeAddressRegs = 0;/* and these are?? */ ctx-VertexProgram._MaintainTnlProgram = GL_TRUE; ctx-FragmentProgram._MaintainTexEnvProgram = GL_TRUE; diff --git a/src/mesa/drivers/dri/r600/r600_context.h b/src/mesa/drivers/dri/r600/r600_context.h index c59df75..9397ecd 100644 --- a/src/mesa/drivers/dri/r600/r600_context.h +++ b/src/mesa/drivers/dri/r600/r600_context.h @@ -86,29 +86,10 @@ extern int hw_tcl_on; #include tnl_dd/t_dd_vertex.h #undef TAG -#define PFS_MAX_ALU_INST 64 -#define PFS_MAX_TEX_INST 64 -#define PFS_MAX_TEX_INDIRECT 4 -#define PFS_NUM_TEMP_REGS 32 -#define PFS_NUM_CONST_REGS 16 - -#define R600_MAX_AOS_ARRAYS16 - -#define REG_COORDS 0 -#define REG_COLOR0 1 -#define REG_TEX0 2 - #define R600_FALLBACK_NONE 0 #define R600_FALLBACK_TCL 1 #define R600_FALLBACK_RAST 2 -enum -{ -NO_SHIFT= 0, -
Mesa (mesa_7_6_branch): r600: fix typo in the last commit
Module: Mesa Branch: mesa_7_6_branch Commit: 639fb1472d09281a8df3792c9bcbc59cd4424688 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=639fb1472d09281a8df3792c9bcbc59cd4424688 Author: Alex Deucher alexdeuc...@gmail.com Date: Mon Sep 21 16:48:55 2009 -0400 r600: fix typo in the last commit 128 gprs, 256 reg-based consts --- src/mesa/drivers/dri/r600/r600_context.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 414c5ae..e0b77d4 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -327,16 +327,16 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, _tnl_allow_pixel_fog(ctx, GL_FALSE); _tnl_allow_vertex_fog(ctx, GL_TRUE); - /* currently bogus data */ + /* 256 for reg-based consts, inline consts also supported */ ctx-Const.VertexProgram.MaxInstructions = 8192; /* in theory no limit */ ctx-Const.VertexProgram.MaxNativeInstructions = 8192; ctx-Const.VertexProgram.MaxNativeAttribs = 160; - ctx-Const.VertexProgram.MaxTemps = 256; /* 256 for reg-based constants, inline consts also supported */ - ctx-Const.VertexProgram.MaxNativeTemps = 256; - ctx-Const.VertexProgram.MaxNativeParameters = 256; /* ??? */ + ctx-Const.VertexProgram.MaxTemps = 128; + ctx-Const.VertexProgram.MaxNativeTemps = 128; + ctx-Const.VertexProgram.MaxNativeParameters = 256; ctx-Const.VertexProgram.MaxNativeAddressRegs = 1; /* ??? */ - ctx-Const.FragmentProgram.MaxNativeTemps = 256; + ctx-Const.FragmentProgram.MaxNativeTemps = 128; ctx-Const.FragmentProgram.MaxNativeAttribs = 32; ctx-Const.FragmentProgram.MaxNativeParameters = 256; ctx-Const.FragmentProgram.MaxNativeAluInstructions = 8192; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): r600: add support for CUBE textures, also TXP
Module: Mesa Branch: mesa_7_6_branch Commit: 2058dfaa47704abc62aa5aa9719013624f26764d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2058dfaa47704abc62aa5aa9719013624f26764d Author: Andre Maasikas amaasi...@gmail.com Date: Wed Sep 23 14:20:59 2009 +0300 r600: add support for CUBE textures, also TXP seems to work here ... --- src/mesa/drivers/dri/r600/r700_assembler.c | 306 +++- src/mesa/drivers/dri/r600/r700_assembler.h |4 + 2 files changed, 263 insertions(+), 47 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index f46bc32..00eda54 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -213,7 +213,7 @@ GLboolean is_reduction_opcode(PVSDWORD* dest) { if (dest-dst.op3 == 0) { -if ( (dest-dst.opcode == SQ_OP2_INST_DOT4 || dest-dst.opcode == SQ_OP2_INST_DOT4_IEEE) ) +if ( (dest-dst.opcode == SQ_OP2_INST_DOT4 || dest-dst.opcode == SQ_OP2_INST_DOT4_IEEE || dest-dst.opcode == SQ_OP2_INST_CUBE) ) { return GL_TRUE; } @@ -350,6 +350,7 @@ unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm) case SQ_OP2_INST_PRED_SETNE: case SQ_OP2_INST_DOT4: case SQ_OP2_INST_DOT4_IEEE: +case SQ_OP2_INST_CUBE: return 2; case SQ_OP2_INST_MOV: @@ -469,6 +470,9 @@ int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700 pAsm-number_of_inputs = 0; + pAsm-is_tex = GL_FALSE; + pAsm-need_tex_barrier = GL_FALSE; + return 0; } @@ -682,7 +686,7 @@ GLboolean add_tex_instruction(r700_AssemblerBase* pAsm, // If this clause constains any TEX instruction that is dependent on a previous instruction, // set the barrier bit -if( pAsm-pInstDeps[pAsm-uiCurInst].nDstDep (-1) ) +if( pAsm-pInstDeps[pAsm-uiCurInst].nDstDep (-1) || pAsm-need_tex_barrier == GL_TRUE ) { pAsm-cf_current_tex_clause_ptr-m_Word1.f.barrier = 0x1; } @@ -1152,42 +1156,48 @@ GLboolean tex_src(r700_AssemblerBase *pAsm) GLboolean bValidTexCoord = GL_FALSE; +if(pAsm-aArgSubst[1] = 0) +{ +bValidTexCoord = GL_TRUE; +setaddrmode_PVSSRC((pAsm-S[0].src), ADDR_ABSOLUTE); +pAsm-S[0].src.rtype = SRC_REG_TEMPORARY; +pAsm-S[0].src.reg = pAsm-aArgSubst[1]; +} +else +{ switch (pILInst-SrcReg[0].File) { -case PROGRAM_CONSTANT: -case PROGRAM_LOCAL_PARAM: -case PROGRAM_ENV_PARAM: -case PROGRAM_STATE_VAR: - bValidTexCoord = GL_TRUE; - setaddrmode_PVSSRC((pAsm-S[0].src), ADDR_ABSOLUTE); - pAsm-S[0].src.rtype = SRC_REG_TEMPORARY; - pAsm-S[0].src.reg = pAsm-aArgSubst[1]; - break; -case PROGRAM_TEMPORARY: - bValidTexCoord = GL_TRUE; - pAsm-S[0].src.reg = pILInst-SrcReg[0].Index + - pAsm-starting_temp_register_number; - pAsm-S[0].src.rtype = SRC_REG_TEMPORARY; - break; -case PROGRAM_INPUT: - switch (pILInst-SrcReg[0].Index) - { - case FRAG_ATTRIB_COL0: - case FRAG_ATTRIB_COL1: - case FRAG_ATTRIB_TEX0: - case FRAG_ATTRIB_TEX1: - case FRAG_ATTRIB_TEX2: - case FRAG_ATTRIB_TEX3: - case FRAG_ATTRIB_TEX4: - case FRAG_ATTRIB_TEX5: - case FRAG_ATTRIB_TEX6: - case FRAG_ATTRIB_TEX7: - bValidTexCoord = GL_TRUE; - pAsm-S[0].src.reg = - pAsm-uiFP_AttributeMap[pILInst-SrcReg[0].Index]; - pAsm-S[0].src.rtype = SRC_REG_INPUT; - break; - } - break; +case PROGRAM_CONSTANT: +case PROGRAM_LOCAL_PARAM: +case PROGRAM_ENV_PARAM: +case PROGRAM_STATE_VAR: +break; +case PROGRAM_TEMPORARY: +bValidTexCoord = GL_TRUE; +pAsm-S[0].src.reg = pILInst-SrcReg[0].Index + +pAsm-starting_temp_register_number; +pAsm-S[0].src.rtype = SRC_REG_TEMPORARY; +break; +case PROGRAM_INPUT: +switch (pILInst-SrcReg[0].Index) +{ +case FRAG_ATTRIB_COL0: +case FRAG_ATTRIB_COL1: +case FRAG_ATTRIB_TEX0: +case FRAG_ATTRIB_TEX1: +case FRAG_ATTRIB_TEX2: + case FRAG_ATTRIB_TEX3: +case FRAG_ATTRIB_TEX4: +case FRAG_ATTRIB_TEX5: +case FRAG_ATTRIB_TEX6: +case FRAG_ATTRIB_TEX7: +bValidTexCoord = GL_TRUE; +pAsm-S[0].src.reg = +pAsm-uiFP_AttributeMap[pILInst-SrcReg[0].Index]; +pAsm-S[0].src.rtype = SRC_REG_INPUT; +break; +} +break; +}
Mesa (master): r600 : disable draw_prim for now.
Module: Mesa Branch: master Commit: 41c5f113b5d41649db2027c3f32deaf4d38035ce URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=41c5f113b5d41649db2027c3f32deaf4d38035ce Author: Richard Li richardrad...@gmail.com Date: Thu Sep 24 10:12:40 2009 -0400 r600 : disable draw_prim for now. --- src/mesa/drivers/dri/r600/r700_render.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index bbe364b..5627984 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -1145,8 +1145,11 @@ static void r700DrawPrims(GLcontext *ctx, void r700InitDraw(GLcontext *ctx) { struct vbo_context *vbo = vbo_context(ctx); - + + /* to be enabled */ + /* vbo-draw_prims = r700DrawPrims; + */ } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): glsl: init var to silence warning
Module: Mesa Branch: mesa_7_6_branch Commit: 00ddd4f9e9680132872f98f2d18b52dfc30c6f2f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=00ddd4f9e9680132872f98f2d18b52dfc30c6f2f Author: Brian Paul bri...@vmware.com Date: Wed Sep 23 15:44:18 2009 -0600 glsl: init var to silence warning --- src/mesa/shader/slang/slang_codegen.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 349f432..703af9f 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2775,7 +2775,7 @@ _slang_gen_while(slang_assemble_ctx * A, slang_operation *oper) *body code (child[1]) */ slang_ir_node *loop, *breakIf, *body; - GLboolean isConst, constTrue; + GLboolean isConst, constTrue = GL_FALSE; if (!A-EmitContReturn) { /* We don't want to emit CONT instructions. If this while-loop has ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): glsl: fix missing initializers warning
Module: Mesa Branch: mesa_7_6_branch Commit: e44c084be536c021985a8908db4300c764c63bbc URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e44c084be536c021985a8908db4300c764c63bbc Author: Brian Paul bri...@vmware.com Date: Wed Sep 23 15:44:02 2009 -0600 glsl: fix missing initializers warning --- src/mesa/shader/slang/slang_builtin.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c index bef0f85..e580950 100644 --- a/src/mesa/shader/slang/slang_builtin.c +++ b/src/mesa/shader/slang/slang_builtin.c @@ -741,7 +741,7 @@ static const struct input_info vertInputs[] = { { gl_MultiTexCoord5, VERT_ATTRIB_TEX5, GL_FLOAT_VEC4, SWIZZLE_NOOP }, { gl_MultiTexCoord6, VERT_ATTRIB_TEX6, GL_FLOAT_VEC4, SWIZZLE_NOOP }, { gl_MultiTexCoord7, VERT_ATTRIB_TEX7, GL_FLOAT_VEC4, SWIZZLE_NOOP }, - { NULL, 0, SWIZZLE_NOOP } + { NULL, 0, GL_NONE, SWIZZLE_NOOP } }; /** Predefined fragment shader inputs */ @@ -754,7 +754,7 @@ static const struct input_info fragInputs[] = { { gl_FogFragCoord, FRAG_ATTRIB_FOGC, GL_FLOAT, SWIZZLE_ }, { gl_FrontFacing, FRAG_ATTRIB_FACE, GL_FLOAT, SWIZZLE_ }, { gl_PointCoord, FRAG_ATTRIB_PNTC, GL_FLOAT_VEC2, SWIZZLE_XYZW }, - { NULL, 0, SWIZZLE_NOOP } + { NULL, 0, GL_NONE, SWIZZLE_NOOP } }; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): mesa: added default case return to silence warning
Module: Mesa Branch: mesa_7_6_branch Commit: a491e25b1fa8683f538ed0d67a6389f2cdf7e4bc URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a491e25b1fa8683f538ed0d67a6389f2cdf7e4bc Author: Brian Paul bri...@vmware.com Date: Wed Sep 23 15:44:37 2009 -0600 mesa: added default case return to silence warning --- src/mesa/main/texenvprogram.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 2f3e47e..d7e77e7 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -276,6 +276,7 @@ need_saturate( GLuint mode ) return GL_TRUE; default: assert(0); + return GL_FALSE; } } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): tgsi/sse: Pass the lodbias, not zero. More comments.
Module: Mesa Branch: mesa_7_6_branch Commit: a64d4516a0d6219dec0b5b0622215918469faecc URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a64d4516a0d6219dec0b5b0622215918469faecc Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 10:26:56 2009 -0600 tgsi/sse: Pass the lodbias, not zero. More comments. This fixes the glean/glsl1 texture2D(), with bias test when using SSE. --- src/gallium/auxiliary/tgsi/tgsi_sse2.c | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_sse2.c b/src/gallium/auxiliary/tgsi/tgsi_sse2.c index 3cdf8b9..1e71994 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_sse2.c +++ b/src/gallium/auxiliary/tgsi/tgsi_sse2.c @@ -1431,11 +1431,11 @@ fetch_texel( struct tgsi_sampler **sampler, { float rgba[NUM_CHANNELS][QUAD_SIZE]; (*sampler)-get_samples(*sampler, - store[0], - store[4], - store[8], - 0.0f, /*store[12], lodbias */ - rgba); + store[0], /* s */ + store[4], /* t */ + store[8], /* r */ + store[12], /* lodbias */ + rgba); /* results */ memcpy( store, rgba, 16 * sizeof(float)); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): tgsi/sse: remove old comments
Module: Mesa Branch: master Commit: f85816354c9538e3b1082f019c4c65c56a8bd77f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f85816354c9538e3b1082f019c4c65c56a8bd77f Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 09:54:36 2009 -0600 tgsi/sse: remove old comments --- src/gallium/auxiliary/tgsi/tgsi_sse2.c |8 1 files changed, 0 insertions(+), 8 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_sse2.c b/src/gallium/auxiliary/tgsi/tgsi_sse2.c index fe76c8c..6f1532a 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_sse2.c +++ b/src/gallium/auxiliary/tgsi/tgsi_sse2.c @@ -1855,7 +1855,6 @@ emit_instruction( break; case TGSI_OPCODE_RCP: - /* TGSI_OPCODE_RECIP */ FETCH( func, *inst, 0, 0, CHAN_X ); emit_rcp( func, 0, 0 ); FOR_EACH_DST0_ENABLED_CHANNEL( *inst, chan_index ) { @@ -1864,7 +1863,6 @@ emit_instruction( break; case TGSI_OPCODE_RSQ: - /* TGSI_OPCODE_RECIPSQRT */ FETCH( func, *inst, 0, 0, CHAN_X ); emit_abs( func, 0 ); emit_rsqrt( func, 1, 0 ); @@ -1962,7 +1960,6 @@ emit_instruction( break; case TGSI_OPCODE_DP3: - /* TGSI_OPCODE_DOT3 */ FETCH( func, *inst, 0, 0, CHAN_X ); FETCH( func, *inst, 1, 1, CHAN_X ); emit_mul( func, 0, 1 ); @@ -1980,7 +1977,6 @@ emit_instruction( break; case TGSI_OPCODE_DP4: - /* TGSI_OPCODE_DOT4 */ FETCH( func, *inst, 0, 0, CHAN_X ); FETCH( func, *inst, 1, 1, CHAN_X ); emit_mul( func, 0, 1 ); @@ -2051,17 +2047,14 @@ emit_instruction( break; case TGSI_OPCODE_SLT: - /* TGSI_OPCODE_SETLT */ emit_setcc( func, inst, cc_LessThan ); break; case TGSI_OPCODE_SGE: - /* TGSI_OPCODE_SETGE */ emit_setcc( func, inst, cc_NotLessThan ); break; case TGSI_OPCODE_MAD: - /* TGSI_OPCODE_MADD */ FOR_EACH_DST0_ENABLED_CHANNEL( *inst, chan_index ) { FETCH( func, *inst, 0, 0, chan_index ); FETCH( func, *inst, 1, 1, chan_index ); @@ -2379,7 +2372,6 @@ emit_instruction( break; case TGSI_OPCODE_SSG: - /* TGSI_OPCODE_SGN */ FOR_EACH_DST0_ENABLED_CHANNEL( *inst, chan_index ) { FETCH( func, *inst, 0, 0, chan_index ); emit_sgn( func, 0, 0 ); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): tgsi/sse: implement SEQ, SGT, SLE, SNE
Module: Mesa Branch: master Commit: 35cd0bbfb171d200b8100e9f79a55c9981c946aa URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=35cd0bbfb171d200b8100e9f79a55c9981c946aa Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 09:51:05 2009 -0600 tgsi/sse: implement SEQ, SGT, SLE, SNE --- src/gallium/auxiliary/tgsi/tgsi_sse2.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_sse2.c b/src/gallium/auxiliary/tgsi/tgsi_sse2.c index 501fc05..fe76c8c 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_sse2.c +++ b/src/gallium/auxiliary/tgsi/tgsi_sse2.c @@ -2291,7 +2291,7 @@ emit_instruction( break; case TGSI_OPCODE_SEQ: - return 0; + emit_setcc( func, inst, cc_Equal ); break; case TGSI_OPCODE_SFL: @@ -2299,7 +2299,7 @@ emit_instruction( break; case TGSI_OPCODE_SGT: - return 0; + emit_setcc( func, inst, cc_NotLessThanEqual ); break; case TGSI_OPCODE_SIN: @@ -2311,11 +2311,11 @@ emit_instruction( break; case TGSI_OPCODE_SLE: - return 0; + emit_setcc( func, inst, cc_LessThanEqual ); break; case TGSI_OPCODE_SNE: - return 0; + emit_setcc( func, inst, cc_NotEqual ); break; case TGSI_OPCODE_STR: ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): gallium/trace: casts to silence warnings
Module: Mesa Branch: master Commit: 6be2bc56af5c0d281d07e427863789e949904db1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6be2bc56af5c0d281d07e427863789e949904db1 Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 10:47:42 2009 -0600 gallium/trace: casts to silence warnings --- src/gallium/drivers/trace/tr_context.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/trace/tr_context.c b/src/gallium/drivers/trace/tr_context.c index 4940ce6..bf470b4 100644 --- a/src/gallium/drivers/trace/tr_context.c +++ b/src/gallium/drivers/trace/tr_context.c @@ -126,10 +126,10 @@ trace_context_draw_block(struct trace_context *tr_ctx, int flag) (tr_ctx-draw_blocker 4)) { boolean block = FALSE; debug_printf(%s (%p %p) (%p %p) (%p %u) (%p %u)\n, __FUNCTION__, - tr_ctx-draw_rule.fs, tr_ctx-curr.fs, - tr_ctx-draw_rule.vs, tr_ctx-curr.vs, - tr_ctx-draw_rule.surf, 0, - tr_ctx-draw_rule.tex, 0); + (void *) tr_ctx-draw_rule.fs, (void *) tr_ctx-curr.fs, + (void *) tr_ctx-draw_rule.vs, (void *) tr_ctx-curr.vs, + (void *) tr_ctx-draw_rule.surf, 0, + (void *) tr_ctx-draw_rule.tex, 0); if (tr_ctx-draw_rule.fs tr_ctx-draw_rule.fs == tr_ctx-curr.fs) block = TRUE; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): st/mesa: trim calculated userbuffer size
Module: Mesa Branch: mesa_7_6_branch Commit: be66ff51ec98cf583044b3e53a49c41edd803134 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=be66ff51ec98cf583044b3e53a49c41edd803134 Author: Keith Whitwell kei...@vmware.com Date: Wed Sep 23 14:40:45 2009 +0100 st/mesa: trim calculated userbuffer size In get_array_bounds we were previously defining a user buffer sized as (nr_vertices * stride). The trouble is that if the vertex data occupies less than stride bytes, the extra tailing (stride - size) bytes may extend outside the memory actually allocated by the app and caused a segfault. To fix this, define a the buffer bounds to be: ptr .. ptr + (nr-1)*stride + element_size --- src/mesa/state_tracker/st_draw.c | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 225541a..11699d5 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -317,23 +317,29 @@ get_arrays_bounds(const struct st_vertex_program *vp, const GLubyte **low, const GLubyte **high) { const GLubyte *low_addr = NULL; + const GLubyte *high_addr = NULL; GLuint attr; - GLint stride; for (attr = 0; attr vp-num_inputs; attr++) { const GLuint mesaAttr = vp-index_to_input[attr]; + const GLint stride = arrays[mesaAttr]-StrideB; const GLubyte *start = arrays[mesaAttr]-Ptr; - stride = arrays[mesaAttr]-StrideB; + const unsigned sz = (arrays[mesaAttr]-Size * + _mesa_sizeof_type(arrays[mesaAttr]-Type)); + const GLubyte *end = start + (max_index * stride) + sz; + if (attr == 0) { low_addr = start; + high_addr = end; } else { low_addr = MIN2(low_addr, start); + high_addr = MAX2(high_addr, end); } } *low = low_addr; - *high = low_addr + (max_index + 1) * stride; + *high = high_addr; } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): swrast: fix typo in partial derivatives parameter passing
Module: Mesa Branch: mesa_7_6_branch Commit: ad935c3f4708417641dd3c257912ccce11485acc URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ad935c3f4708417641dd3c257912ccce11485acc Author: Brian Paul bri...@vmware.com Date: Wed Sep 23 12:54:14 2009 -0600 swrast: fix typo in partial derivatives parameter passing --- src/mesa/swrast/s_fragprog.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index b71fb9e..144f78b 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -108,7 +108,7 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], lambda = _swrast_compute_lambda(texdx[0], texdy[0], /* ds/dx, ds/dy */ texdx[1], texdy[1], /* dt/dx, dt/dy */ - texdx[3], texdy[2], /* dq/dx, dq/dy */ + texdx[3], texdy[3], /* dq/dx, dq/dy */ texW, texH, texcoord[0], texcoord[1], texcoord[3], 1.0F / texcoord[3]) + lodBias; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): mesa: don't bias LOD in shader interpreter; do it in swrast
Module: Mesa Branch: mesa_7_6_branch Commit: 890f37d4d96471a5c3d8ae286dfc13ad18ff78e5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=890f37d4d96471a5c3d8ae286dfc13ad18ff78e5 Author: Brian Paul bri...@vmware.com Date: Wed Sep 23 13:34:30 2009 -0600 mesa: don't bias LOD in shader interpreter; do it in swrast --- src/mesa/shader/prog_execute.c |7 +-- 1 files changed, 1 insertions(+), 6 deletions(-) diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index 68a5935..7cb463c 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -1527,17 +1527,12 @@ _mesa_execute_program(GLcontext * ctx, case OPCODE_TXB: /* GL_ARB_fragment_program only */ /* Texel lookup with LOD bias */ { -const GLuint unit = machine-Samplers[inst-TexSrcUnit]; -const struct gl_texture_unit *texUnit = ctx-Texture.Unit[unit]; GLfloat texcoord[4], color[4], lodBias; fetch_vector4(inst-SrcReg[0], machine, texcoord); /* texcoord[3] is the bias to add to lambda */ -lodBias = texUnit-LodBias + texcoord[3]; -if (texUnit-_Current) { - lodBias += texUnit-_Current-LodBias; -} +lodBias = texcoord[3]; fetch_texel(ctx, machine, inst, texcoord, lodBias, color); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): swrast: add lod bias when texture sampling
Module: Mesa Branch: mesa_7_6_branch Commit: 2acd5de22651a3461c0576107c8e8fab1f01469a URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2acd5de22651a3461c0576107c8e8fab1f01469a Author: Brian Paul bri...@vmware.com Date: Wed Sep 23 13:35:03 2009 -0600 swrast: add lod bias when texture sampling Mostly fixes progs/demos/lodbias when MESA_TEX_PROG=1. But the LOD still seems off by -1 or so. May be an issue with the params passed to _swrast_compute_lambda() --- src/mesa/swrast/s_fragprog.c |9 +++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 144f78b..b326acf 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -89,6 +89,8 @@ fetch_texel_lod( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, * Fetch a texel with the given partial derivatives to compute a level * of detail in the mipmap. * Called via machine-FetchTexelDeriv() + * \param lodBias the lod bias which may be specified by a TXB instruction, + * otherwise zero. */ static void fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], @@ -96,7 +98,8 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lodBias, GLuint unit, GLfloat color[4] ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - const struct gl_texture_object *texObj = ctx-Texture.Unit[unit]._Current; + const struct gl_texture_unit *texUnit = ctx-Texture.Unit[unit]; + const struct gl_texture_object *texObj = texUnit-_Current; if (texObj) { const struct gl_texture_image *texImg = @@ -111,7 +114,9 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], texdx[3], texdy[3], /* dq/dx, dq/dy */ texW, texH, texcoord[0], texcoord[1], texcoord[3], - 1.0F / texcoord[3]) + lodBias; + 1.0F / texcoord[3]); + + lambda += lodBias + texUnit-LodBias + texObj-LodBias; lambda = CLAMP(lambda, texObj-MinLod, texObj-MaxLod); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): Merge branch 'mesa_7_5_branch' into mesa_7_6_branch
Module: Mesa Branch: mesa_7_6_branch Commit: 7549a8397b310acf672f97a08c8e7d866cdf492c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7549a8397b310acf672f97a08c8e7d866cdf492c Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 10:52:15 2009 -0600 Merge branch 'mesa_7_5_branch' into mesa_7_6_branch --- ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): 28 new commits
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c9f7a23ef05adfd2ebae56ee9f1b19897a589831 Merge: 6be2bc56af5c0d281d07e427863789e949904db1 7549a8397b310acf672f97a08c8e7d866cdf492c Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 11:03:16 2009 -0600 Merge branch 'mesa_7_6_branch' Conflicts: src/mesa/drivers/dri/r600/r700_assembler.c src/mesa/drivers/dri/r600/r700_chip.c src/mesa/drivers/dri/r600/r700_render.c src/mesa/drivers/dri/r600/r700_vertprog.c src/mesa/drivers/dri/r600/r700_vertprog.h src/mesa/drivers/dri/radeon/radeon_span.c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7549a8397b310acf672f97a08c8e7d866cdf492c Merge: a64d4516a0d6219dec0b5b0622215918469faecc 2acd5de22651a3461c0576107c8e8fab1f01469a Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 10:52:15 2009 -0600 Merge branch 'mesa_7_5_branch' into mesa_7_6_branch URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a64d4516a0d6219dec0b5b0622215918469faecc Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 10:26:56 2009 -0600 tgsi/sse: Pass the lodbias, not zero. More comments. This fixes the glean/glsl1 texture2D(), with bias test when using SSE. URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a491e25b1fa8683f538ed0d67a6389f2cdf7e4bc Author: Brian Paul bri...@vmware.com Date: Wed Sep 23 15:44:37 2009 -0600 mesa: added default case return to silence warning URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=00ddd4f9e9680132872f98f2d18b52dfc30c6f2f Author: Brian Paul bri...@vmware.com Date: Wed Sep 23 15:44:18 2009 -0600 glsl: init var to silence warning URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e44c084be536c021985a8908db4300c764c63bbc Author: Brian Paul bri...@vmware.com Date: Wed Sep 23 15:44:02 2009 -0600 glsl: fix missing initializers warning URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2058dfaa47704abc62aa5aa9719013624f26764d Author: Andre Maasikas amaasi...@gmail.com Date: Wed Sep 23 14:20:59 2009 +0300 r600: add support for CUBE textures, also TXP seems to work here ... URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=639fb1472d09281a8df3792c9bcbc59cd4424688 Author: Alex Deucher alexdeuc...@gmail.com Date: Mon Sep 21 16:48:55 2009 -0400 r600: fix typo in the last commit 128 gprs, 256 reg-based consts URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=28308c92605229129a12a2273dda47c6a2ca4790 Author: Alex Deucher alexdeuc...@gmail.com Date: Mon Sep 21 16:30:14 2009 -0400 r600: various cleanups - max texture size is 8k, but mesa doesn't support that at the moment. - attempt to set shader limits to what the hw actually supports - clean up some old r300 cruft - no need to explicitly disable irqs. This is fixed in the drm now. Signed-off-by: Alex Deucher alexdeuc...@gmail.com URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ed91d103477d563f73be3555d1022ec9af073467 Author: Andre Maasikas amaasi...@gmail.com Date: Mon Sep 21 10:14:25 2009 -0400 r600: fix some issues with LIT instruction - MUL_LIT is ALU.Trans instruction - some Trans instructions can take 3 arguments - don't clobber dst.x, use dst.z as temp, it'll get written correct value in last insn - respect source swizzles URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=48559c76056e09ca4f9e4f39e9008f6d32ecd5b0 Author: Alex Deucher alexdeuc...@gmail.com Date: Sat Sep 19 15:18:42 2009 -0400 r600: fix point sizes registers takes radius URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=095db818c6c7ed5706b5f31d17d0cb19c03cb67a Author: Alex Deucher alexdeuc...@gmail.com Date: Sat Sep 19 14:46:06 2009 -0400 r600: fix polygon offset URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ec14d59afa952b4e53ad268971098584686a6fca Author: Alex Deucher alexdeuc...@gmail.com Date: Tue Sep 15 17:12:03 2009 -0400 radeon: don't build non-r600 span code on r600 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=dbec27be856584bc5205c7eeeca2b7e98299d4cb Author: Alex Deucher alexdeuc...@gmail.com Date: Tue Sep 15 16:58:37 2009 -0400 r600: minor span cleanups URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2cd2dc34ac93dd929ec8f01cf1f7f8dfa6b34d0d Author: Andre Maasikas amaasi...@gmail.com Date: Tue Sep 15 11:27:51 2009 -0400 r600: support position_invariant programs URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9437ac9bccd294bd5a8b838e7ca7597e5dc6d5b0 Author: Alex Deucher alexdeuc...@gmail.com Date: Mon Sep 14 18:05:15 2009 -0400 r600: add span support for 1D tiles 1D tile span support for depth/stencil/color/textures Z and stencil buffers are always tiled, so this fixes sw access to Z and stencil buffers. color and textures are currently
Mesa (mesa_7_6_branch): radeon: Fix scissors for r600 KMS.
Module: Mesa Branch: mesa_7_6_branch Commit: 1d2dca194cebe6e25735b6820f85b8d1231aae63 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1d2dca194cebe6e25735b6820f85b8d1231aae63 Author: Pauli Nieminen suok...@gmail.com Date: Thu Sep 24 19:58:09 2009 +0300 radeon: Fix scissors for r600 KMS. Radeon generic scissors code had problem that some of code was using exclusive and some inclusive bottom right corner. Only r600 driver is using exclusive coordinate so changed generic code to pass inclusive coordinate and r600 driver changes BR coordinate to be exclusive. --- src/mesa/drivers/dri/r600/r700_state.c |5 +++-- src/mesa/drivers/dri/radeon/radeon_common.c |8 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 8571563..124469b 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -1269,10 +1269,11 @@ void r700SetScissor(context_t *context) //--- return; } if (context-radeon.state.scissor.enabled) { + /* r600 has exclusive scissors */ x1 = context-radeon.state.scissor.rect.x1; y1 = context-radeon.state.scissor.rect.y1; - x2 = context-radeon.state.scissor.rect.x2; - y2 = context-radeon.state.scissor.rect.y2; + x2 = context-radeon.state.scissor.rect.x2 + 1; + y2 = context-radeon.state.scissor.rect.y2 + 1; } else { if (context-radeon.radeonScreen-driScreen-dri2.enabled) { x1 = 0; diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index a4c7b40..9817ff8 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -232,13 +232,13 @@ void radeonUpdateScissor( GLcontext *ctx ) __DRIdrawablePrivate *dPriv = radeon_get_drawable(rmesa); x1 += dPriv-x; - x2 += dPriv-x + 1; + x2 += dPriv-x; min_x += dPriv-x; - max_x += dPriv-x + 1; + max_x += dPriv-x; y1 += dPriv-y; - y2 += dPriv-y + 1; + y2 += dPriv-y; min_y += dPriv-y; - max_y += dPriv-y + 1; + max_y += dPriv-y; } rmesa-state.scissor.rect.x1 = CLAMP(x1, min_x, max_x); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): radeon: Fix scissors for r600 KMS.
Module: Mesa Branch: master Commit: 1d2dca194cebe6e25735b6820f85b8d1231aae63 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1d2dca194cebe6e25735b6820f85b8d1231aae63 Author: Pauli Nieminen suok...@gmail.com Date: Thu Sep 24 19:58:09 2009 +0300 radeon: Fix scissors for r600 KMS. Radeon generic scissors code had problem that some of code was using exclusive and some inclusive bottom right corner. Only r600 driver is using exclusive coordinate so changed generic code to pass inclusive coordinate and r600 driver changes BR coordinate to be exclusive. --- src/mesa/drivers/dri/r600/r700_state.c |5 +++-- src/mesa/drivers/dri/radeon/radeon_common.c |8 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 8571563..124469b 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -1269,10 +1269,11 @@ void r700SetScissor(context_t *context) //--- return; } if (context-radeon.state.scissor.enabled) { + /* r600 has exclusive scissors */ x1 = context-radeon.state.scissor.rect.x1; y1 = context-radeon.state.scissor.rect.y1; - x2 = context-radeon.state.scissor.rect.x2; - y2 = context-radeon.state.scissor.rect.y2; + x2 = context-radeon.state.scissor.rect.x2 + 1; + y2 = context-radeon.state.scissor.rect.y2 + 1; } else { if (context-radeon.radeonScreen-driScreen-dri2.enabled) { x1 = 0; diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index a4c7b40..9817ff8 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -232,13 +232,13 @@ void radeonUpdateScissor( GLcontext *ctx ) __DRIdrawablePrivate *dPriv = radeon_get_drawable(rmesa); x1 += dPriv-x; - x2 += dPriv-x + 1; + x2 += dPriv-x; min_x += dPriv-x; - max_x += dPriv-x + 1; + max_x += dPriv-x; y1 += dPriv-y; - y2 += dPriv-y + 1; + y2 += dPriv-y; min_y += dPriv-y; - max_y += dPriv-y + 1; + max_y += dPriv-y; } rmesa-state.scissor.rect.x1 = CLAMP(x1, min_x, max_x); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): vbo: limit number of warnings to 10
Module: Mesa Branch: mesa_7_6_branch Commit: 1a816117258e594a073f6925edfcd2387071904d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1a816117258e594a073f6925edfcd2387071904d Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 12:35:51 2009 -0600 vbo: limit number of warnings to 10 Otherwise some apps will emit tons of warnings. --- src/mesa/vbo/vbo_exec_array.c | 43 +++- 1 files changed, 25 insertions(+), 18 deletions(-) diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index 3f0656a..39c2957 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -667,6 +667,7 @@ vbo_exec_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices) { + static GLuint warnCount = 0; GET_CURRENT_CONTEXT(ctx); if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count, @@ -675,15 +676,19 @@ vbo_exec_DrawRangeElements(GLenum mode, if (end = ctx-Array.ArrayObj-_MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ - _mesa_warning(ctx, glDraw[Range]Elements(start %u, end %u, count %d, -type 0x%x, indices=%p)\n -\tend is out of bounds (max=%u) -Element Buffer %u (size %d)\n -\tThis should probably be fixed in the application., -start, end, count, type, indices, -ctx-Array.ArrayObj-_MaxElement - 1, -ctx-Array.ElementArrayBufferObj-Name, -ctx-Array.ElementArrayBufferObj-Size); + warnCount++; + + if (warnCount 10) { + _mesa_warning(ctx, glDraw[Range]Elements(start %u, end %u, count %d, + type 0x%x, indices=%p)\n + \tend is out of bounds (max=%u) + Element Buffer %u (size %d)\n + \tThis should probably be fixed in the application., + start, end, count, type, indices, + ctx-Array.ArrayObj-_MaxElement - 1, + ctx-Array.ElementArrayBufferObj-Name, + ctx-Array.ElementArrayBufferObj-Size); + } if (0) dump_element_buffer(ctx, type); @@ -700,15 +705,17 @@ vbo_exec_DrawRangeElements(GLenum mode, GLuint max = _mesa_max_buffer_index(ctx, count, type, indices, ctx-Array.ElementArrayBufferObj); if (max = ctx-Array.ArrayObj-_MaxElement) { -_mesa_warning(ctx, glDraw[Range]Elements(start %u, end %u, - count %d, type 0x%x, indices=%p)\n - \tindex=%u is out of bounds (max=%u) - Element Buffer %u (size %d)\n - \tSkipping the glDrawRangeElements() call, - start, end, count, type, indices, max, - ctx-Array.ArrayObj-_MaxElement - 1, - ctx-Array.ElementArrayBufferObj-Name, - ctx-Array.ElementArrayBufferObj-Size); +if (warnCount 10) { + _mesa_warning(ctx, glDraw[Range]Elements(start %u, end %u, + count %d, type 0x%x, indices=%p)\n + \tindex=%u is out of bounds (max=%u) + Element Buffer %u (size %d)\n + \tSkipping the glDrawRangeElements() call, + start, end, count, type, indices, max, + ctx-Array.ArrayObj-_MaxElement - 1, + ctx-Array.ElementArrayBufferObj-Name, + ctx-Array.ElementArrayBufferObj-Size); +} return; } /* XXX we could also find the min index and compare to 'start' ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): mesa: added comment
Module: Mesa Branch: mesa_7_6_branch Commit: 964792b0250ece9fe585a4a02544f0e9c4d453a0 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=964792b0250ece9fe585a4a02544f0e9c4d453a0 Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 12:37:06 2009 -0600 mesa: added comment --- src/mesa/shader/prog_parameter.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 6b9e73b..2f029b0 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -100,6 +100,7 @@ _mesa_free_parameter_list(struct gl_program_parameter_list *paramList) * \param type type of parameter, such as * \param name the parameter name, will be duplicated/copied! * \param size number of elements in 'values' vector (1..4, or more) + * \param datatype GL_FLOAT, GL_FLOAT_VECx, GL_INT, GL_INT_VECx or GL_NONE. * \param values initial parameter value, up to 4 GLfloats, or NULL * \param state state indexes, or NULL * \return index of new parameter in the list, or -1 if error (out of mem) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): mesa: replace assertion with no-op function assignment
Module: Mesa Branch: mesa_7_6_branch Commit: f0339f502cf96499bc5cac8c0611f76f3fd39461 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0339f502cf96499bc5cac8c0611f76f3fd39461 Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 12:37:34 2009 -0600 mesa: replace assertion with no-op function assignment --- src/mesa/main/texrender.c | 13 - 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index cc74d58..53be83b 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -398,6 +398,14 @@ texture_put_mono_values(GLcontext *ctx, struct gl_renderbuffer *rb, static void +store_nop(struct gl_texture_image *texImage, + GLint col, GLint row, GLint img, + const void *texel) +{ +} + + +static void delete_texture_wrapper(struct gl_renderbuffer *rb) { ASSERT(rb-RefCount == 0); @@ -462,7 +470,10 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) ASSERT(trb-TexImage); trb-Store = trb-TexImage-TexFormat-StoreTexel; - ASSERT(trb-Store); + if (!trb-Store) { + /* we'll never draw into some textures (compressed formats) */ + trb-Store = store_nop; + } if (att-Texture-Target == GL_TEXTURE_1D_ARRAY_EXT) { trb-Yoffset = att-Zoffset; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): intel: use default array/ element buffers in intel_generate_mipmap()
Module: Mesa Branch: mesa_7_6_branch Commit: b849c6f1b3b38a68fae32d4dea16dd7431e41b6e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b849c6f1b3b38a68fae32d4dea16dd7431e41b6e Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 12:41:14 2009 -0600 intel: use default array/element buffers in intel_generate_mipmap() If there happened to be a bound VBO when intel_generate_mipmap() was called we blew up because of a bad vertex array pointer. Fixes regnumonline, bug 23859. --- src/mesa/drivers/dri/intel/intel_generatemipmap.c | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_generatemipmap.c b/src/mesa/drivers/dri/intel/intel_generatemipmap.c index fe98609..12059e1 100644 --- a/src/mesa/drivers/dri/intel/intel_generatemipmap.c +++ b/src/mesa/drivers/dri/intel/intel_generatemipmap.c @@ -125,6 +125,8 @@ intel_generate_mipmap_2d(GLcontext *ctx, GLuint fb_name; GLboolean success = GL_FALSE; struct gl_framebuffer *saved_fbo = NULL; + struct gl_buffer_object *saved_array_buffer = NULL; + struct gl_buffer_object *saved_element_buffer = NULL; _mesa_PushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT | GL_CURRENT_BIT | GL_COLOR_BUFFER_BIT | @@ -133,6 +135,16 @@ intel_generate_mipmap_2d(GLcontext *ctx, old_active_texture = ctx-Texture.CurrentUnit; _mesa_reference_framebuffer(saved_fbo, ctx-DrawBuffer); + /* use default array/index buffers */ + _mesa_reference_buffer_object(ctx, saved_array_buffer, + ctx-Array.ArrayBufferObj); + _mesa_reference_buffer_object(ctx, ctx-Array.ArrayBufferObj, + ctx-Shared-NullBufferObj); + _mesa_reference_buffer_object(ctx, saved_element_buffer, + ctx-Array.ElementArrayBufferObj); + _mesa_reference_buffer_object(ctx, ctx-Array.ElementArrayBufferObj, + ctx-Shared-NullBufferObj); + _mesa_Disable(GL_POLYGON_STIPPLE); _mesa_Disable(GL_DEPTH_TEST); _mesa_Disable(GL_STENCIL_TEST); @@ -205,6 +217,15 @@ fail: meta_restore_fragment_program(intel-meta); meta_restore_vertex_program(intel-meta); + /* restore array/index buffers */ + _mesa_reference_buffer_object(ctx, ctx-Array.ArrayBufferObj, + saved_array_buffer); + _mesa_reference_buffer_object(ctx, saved_array_buffer, NULL); + _mesa_reference_buffer_object(ctx, ctx-Array.ElementArrayBufferObj, + saved_element_buffer); + _mesa_reference_buffer_object(ctx, saved_element_buffer, NULL); + + _mesa_DeleteFramebuffersEXT(1, fb_name); _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + old_active_texture); if (saved_fbo) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_5_branch): mesa: remove glEnable(GL_DEPTH_BOUNDS_TEST_EXT) check/warning
Module: Mesa Branch: mesa_7_5_branch Commit: 60b152a1b366b1c9b9326dda1d91ab600fbb0d86 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=60b152a1b366b1c9b9326dda1d91ab600fbb0d86 Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 14:24:14 2009 -0600 mesa: remove glEnable(GL_DEPTH_BOUNDS_TEST_EXT) check/warning At the time of the enable there may not be a Z buffer, but one may be attached to the FBO later. --- src/mesa/main/enable.c |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 47d19ab..d1b2175 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -933,11 +933,6 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) /* GL_EXT_depth_bounds_test */ case GL_DEPTH_BOUNDS_TEST_EXT: CHECK_EXTENSION(EXT_depth_bounds_test, cap); - if (state ctx-DrawBuffer-Visual.depthBits == 0) { -_mesa_warning(ctx, - glEnable(GL_DEPTH_BOUNDS_TEST_EXT) but no depth buffer); -return; - } if (ctx-Depth.BoundsTest == state) return; FLUSH_VERTICES(ctx, _NEW_DEPTH); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): i965: Load NV program matrices when required.
Module: Mesa Branch: mesa_7_6_branch Commit: 9018a7dd175caa9a0fbf940b7e66aa9411d2d965 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9018a7dd175caa9a0fbf940b7e66aa9411d2d965 Author: Eric Anholt e...@anholt.net Date: Thu Sep 24 10:40:32 2009 -0700 i965: Load NV program matrices when required. --- src/mesa/drivers/dri/i965/brw_curbe.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c index 0b0e693..4be6c77 100644 --- a/src/mesa/drivers/dri/i965/brw_curbe.c +++ b/src/mesa/drivers/dri/i965/brw_curbe.c @@ -248,6 +248,9 @@ static void prepare_constant_buffer(struct brw_context *brw) GLuint offset = brw-curbe.vs_start * 16; GLuint nr = brw-vs.prog_data-nr_params / 4; + if (brw-vertex_program-IsNVProgram) +_mesa_load_tracked_matrices(ctx); + /* Updates the ParamaterValues[i] pointers for all parameters of the * basic type of PROGRAM_STATE_VAR. */ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): i965: Emit zero initialization for NV VP temporaries as required.
Module: Mesa Branch: mesa_7_6_branch Commit: 726a04a2cd1bf159a6c40584b4b2b9bc5948a82e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=726a04a2cd1bf159a6c40584b4b2b9bc5948a82e Author: Eric Anholt e...@anholt.net Date: Thu Sep 24 11:58:33 2009 -0700 i965: Emit zero initialization for NV VP temporaries as required. This is similar to what r300 does inside the driver, but I've added it as a generic option since it seems most hardware will want it. Fixes piglit nv-init-zero-reg.vpfp and nv-init-zero-addr.vpfp. --- src/mesa/drivers/dri/i965/brw_context.c |1 + src/mesa/main/mtypes.h |1 + src/mesa/shader/nvprogram.c | 44 +++ src/mesa/shader/nvprogram.h |4 +++ src/mesa/shader/nvvertparse.c |1 + 5 files changed, 51 insertions(+), 0 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 3c5b848..c300c33 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -125,6 +125,7 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, /* We want the GLSL compiler to emit code that uses condition codes */ ctx-Shader.EmitCondCodes = GL_TRUE; + ctx-Shader.EmitNVTempInitialization = GL_TRUE; ctx-Const.VertexProgram.MaxNativeInstructions = (16 * 1024); ctx-Const.VertexProgram.MaxAluInstructions = 0; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 6b64bf8..f8e4e41 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2079,6 +2079,7 @@ struct gl_shader_state GLboolean EmitContReturn;/** Emit CONT/RET opcodes? */ GLboolean EmitCondCodes; /** Use condition codes? */ GLboolean EmitComments; /** Annotated instructions */ + GLboolean EmitNVTempInitialization; /** 0-fill NV temp registers */ void *MemPool; GLbitfield Flags;/** Mask of GLSL_x flags */ struct gl_sl_pragmas DefaultPragmas; /** Default #pragma settings */ diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index fdb2f42..471a735 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -509,7 +509,51 @@ _mesa_GetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid **pointer) *pointer = (GLvoid *) ctx-Array.ArrayObj-VertexAttrib[index].Ptr; } +void +_mesa_emit_nv_temp_initialization(GLcontext *ctx, + struct gl_program *program) +{ + struct prog_instruction *inst; + int i; + + if (!ctx-Shader.EmitNVTempInitialization) + return; + /* We'll swizzle up a zero temporary so we can use it for the +* ARL. +*/ + if (program-NumTemporaries == 0) + program-NumTemporaries = 1; + + _mesa_insert_instructions(program, 0, program-NumTemporaries + 1); + + for (i = 0; i program-NumTemporaries; i++) { + struct prog_instruction *inst = program-Instructions[i]; + + inst-Opcode = OPCODE_SWZ; + inst-DstReg.File = PROGRAM_TEMPORARY; + inst-DstReg.Index = i; + inst-DstReg.WriteMask = WRITEMASK_XYZW; + inst-SrcReg[0].File = PROGRAM_TEMPORARY; + inst-SrcReg[0].Index = 0; + inst-SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_ZERO, + SWIZZLE_ZERO, + SWIZZLE_ZERO, + SWIZZLE_ZERO); + } + + inst = program-Instructions[i]; + inst-Opcode = OPCODE_ARL; + inst-DstReg.File = PROGRAM_ADDRESS; + inst-DstReg.Index = 0; + inst-DstReg.WriteMask = WRITEMASK_XYZW; + inst-SrcReg[0].File = PROGRAM_TEMPORARY; + inst-SrcReg[0].Index = 0; + inst-SrcReg[0].Swizzle = SWIZZLE_; + + if (program-NumAddressRegs == 0) + program-NumAddressRegs = 1; +} void _mesa_setup_nv_temporary_count(GLcontext *ctx, struct gl_program *program) diff --git a/src/mesa/shader/nvprogram.h b/src/mesa/shader/nvprogram.h index 0ed143d..8ee5966 100644 --- a/src/mesa/shader/nvprogram.h +++ b/src/mesa/shader/nvprogram.h @@ -106,4 +106,8 @@ _mesa_GetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, extern void _mesa_setup_nv_temporary_count(GLcontext *ctx, struct gl_program *program); +extern void +_mesa_emit_nv_temp_initialization(GLcontext *ctx, + struct gl_program *program); + #endif diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index a94e6b8..6ab8a14 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -1423,6 +1423,7 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, program-Base.NumParameters = program-Base.Parameters-NumParameters; _mesa_setup_nv_temporary_count(ctx, program-Base); + _mesa_emit_nv_temp_initialization(ctx, program-Base); } else { /* Error! */
Mesa (mesa_7_6_branch): mesa: remove rgbMode check in enable_texture()
Module: Mesa Branch: mesa_7_6_branch Commit: adfa778c8ea436d6e62c37327b44f6ff359ed63f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=adfa778c8ea436d6e62c37327b44f6ff359ed63f Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 14:19:06 2009 -0600 mesa: remove rgbMode check in enable_texture() If the currently bound FBO isn't yet validated it's possible for rgbMode to be zero so we'll lose the texture enable. This could fix some FBO rendering glitches, but I don't know of any specific instances. --- src/mesa/main/enable.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index f432be1..47d19ab 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -231,7 +231,7 @@ enable_texture(GLcontext *ctx, GLboolean state, GLbitfield bit) const GLuint newenabled = (!state) ? (texUnit-Enabled ~bit) : (texUnit-Enabled | bit); - if (!ctx-DrawBuffer-Visual.rgbMode || texUnit-Enabled == newenabled) + if (texUnit-Enabled == newenabled) return GL_FALSE; FLUSH_VERTICES(ctx, _NEW_TEXTURE); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): Merge branch 'mesa_7_5_branch' into mesa_7_6_branch
Module: Mesa Branch: mesa_7_6_branch Commit: 940ca2e837efe45caae1cf1d9665f6736347705d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=940ca2e837efe45caae1cf1d9665f6736347705d Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 16:01:26 2009 -0600 Merge branch 'mesa_7_5_branch' into mesa_7_6_branch --- ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: replace assertion with no-op function assignment
Module: Mesa Branch: master Commit: f0339f502cf96499bc5cac8c0611f76f3fd39461 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f0339f502cf96499bc5cac8c0611f76f3fd39461 Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 12:37:34 2009 -0600 mesa: replace assertion with no-op function assignment --- src/mesa/main/texrender.c | 13 - 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index cc74d58..53be83b 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -398,6 +398,14 @@ texture_put_mono_values(GLcontext *ctx, struct gl_renderbuffer *rb, static void +store_nop(struct gl_texture_image *texImage, + GLint col, GLint row, GLint img, + const void *texel) +{ +} + + +static void delete_texture_wrapper(struct gl_renderbuffer *rb) { ASSERT(rb-RefCount == 0); @@ -462,7 +470,10 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) ASSERT(trb-TexImage); trb-Store = trb-TexImage-TexFormat-StoreTexel; - ASSERT(trb-Store); + if (!trb-Store) { + /* we'll never draw into some textures (compressed formats) */ + trb-Store = store_nop; + } if (att-Texture-Target == GL_TEXTURE_1D_ARRAY_EXT) { trb-Yoffset = att-Zoffset; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): intel: use default array/ element buffers in intel_generate_mipmap()
Module: Mesa Branch: master Commit: b849c6f1b3b38a68fae32d4dea16dd7431e41b6e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b849c6f1b3b38a68fae32d4dea16dd7431e41b6e Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 12:41:14 2009 -0600 intel: use default array/element buffers in intel_generate_mipmap() If there happened to be a bound VBO when intel_generate_mipmap() was called we blew up because of a bad vertex array pointer. Fixes regnumonline, bug 23859. --- src/mesa/drivers/dri/intel/intel_generatemipmap.c | 21 + 1 files changed, 21 insertions(+), 0 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_generatemipmap.c b/src/mesa/drivers/dri/intel/intel_generatemipmap.c index fe98609..12059e1 100644 --- a/src/mesa/drivers/dri/intel/intel_generatemipmap.c +++ b/src/mesa/drivers/dri/intel/intel_generatemipmap.c @@ -125,6 +125,8 @@ intel_generate_mipmap_2d(GLcontext *ctx, GLuint fb_name; GLboolean success = GL_FALSE; struct gl_framebuffer *saved_fbo = NULL; + struct gl_buffer_object *saved_array_buffer = NULL; + struct gl_buffer_object *saved_element_buffer = NULL; _mesa_PushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT | GL_CURRENT_BIT | GL_COLOR_BUFFER_BIT | @@ -133,6 +135,16 @@ intel_generate_mipmap_2d(GLcontext *ctx, old_active_texture = ctx-Texture.CurrentUnit; _mesa_reference_framebuffer(saved_fbo, ctx-DrawBuffer); + /* use default array/index buffers */ + _mesa_reference_buffer_object(ctx, saved_array_buffer, + ctx-Array.ArrayBufferObj); + _mesa_reference_buffer_object(ctx, ctx-Array.ArrayBufferObj, + ctx-Shared-NullBufferObj); + _mesa_reference_buffer_object(ctx, saved_element_buffer, + ctx-Array.ElementArrayBufferObj); + _mesa_reference_buffer_object(ctx, ctx-Array.ElementArrayBufferObj, + ctx-Shared-NullBufferObj); + _mesa_Disable(GL_POLYGON_STIPPLE); _mesa_Disable(GL_DEPTH_TEST); _mesa_Disable(GL_STENCIL_TEST); @@ -205,6 +217,15 @@ fail: meta_restore_fragment_program(intel-meta); meta_restore_vertex_program(intel-meta); + /* restore array/index buffers */ + _mesa_reference_buffer_object(ctx, ctx-Array.ArrayBufferObj, + saved_array_buffer); + _mesa_reference_buffer_object(ctx, saved_array_buffer, NULL); + _mesa_reference_buffer_object(ctx, ctx-Array.ElementArrayBufferObj, + saved_element_buffer); + _mesa_reference_buffer_object(ctx, saved_element_buffer, NULL); + + _mesa_DeleteFramebuffersEXT(1, fb_name); _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + old_active_texture); if (saved_fbo) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: remove rgbMode check in enable_texture()
Module: Mesa Branch: master Commit: adfa778c8ea436d6e62c37327b44f6ff359ed63f URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=adfa778c8ea436d6e62c37327b44f6ff359ed63f Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 14:19:06 2009 -0600 mesa: remove rgbMode check in enable_texture() If the currently bound FBO isn't yet validated it's possible for rgbMode to be zero so we'll lose the texture enable. This could fix some FBO rendering glitches, but I don't know of any specific instances. --- src/mesa/main/enable.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index f432be1..47d19ab 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -231,7 +231,7 @@ enable_texture(GLcontext *ctx, GLboolean state, GLbitfield bit) const GLuint newenabled = (!state) ? (texUnit-Enabled ~bit) : (texUnit-Enabled | bit); - if (!ctx-DrawBuffer-Visual.rgbMode || texUnit-Enabled == newenabled) + if (texUnit-Enabled == newenabled) return GL_FALSE; FLUSH_VERTICES(ctx, _NEW_TEXTURE); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: remove glEnable(GL_DEPTH_BOUNDS_TEST_EXT) check/ warning
Module: Mesa Branch: master Commit: 60b152a1b366b1c9b9326dda1d91ab600fbb0d86 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=60b152a1b366b1c9b9326dda1d91ab600fbb0d86 Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 14:24:14 2009 -0600 mesa: remove glEnable(GL_DEPTH_BOUNDS_TEST_EXT) check/warning At the time of the enable there may not be a Z buffer, but one may be attached to the FBO later. --- src/mesa/main/enable.c |5 - 1 files changed, 0 insertions(+), 5 deletions(-) diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 47d19ab..d1b2175 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -933,11 +933,6 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) /* GL_EXT_depth_bounds_test */ case GL_DEPTH_BOUNDS_TEST_EXT: CHECK_EXTENSION(EXT_depth_bounds_test, cap); - if (state ctx-DrawBuffer-Visual.depthBits == 0) { -_mesa_warning(ctx, - glEnable(GL_DEPTH_BOUNDS_TEST_EXT) but no depth buffer); -return; - } if (ctx-Depth.BoundsTest == state) return; FLUSH_VERTICES(ctx, _NEW_DEPTH); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: Initialize NV_vertex_program fields for the parameter lists and such.
Module: Mesa Branch: master Commit: 601769a2c0071e23ade32de4e8911d75d7f324d2 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=601769a2c0071e23ade32de4e8911d75d7f324d2 Author: Eric Anholt e...@anholt.net Date: Wed Sep 23 16:49:52 2009 -0700 mesa: Initialize NV_vertex_program fields for the parameter lists and such. This helps let drivers treat NV_vp like ARB_vp. --- src/mesa/shader/nvprogram.c | 28 src/mesa/shader/nvprogram.h |2 ++ src/mesa/shader/nvvertparse.c | 25 + 3 files changed, 55 insertions(+), 0 deletions(-) diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index d6469b1..fdb2f42 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -511,6 +511,34 @@ _mesa_GetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid **pointer) +void +_mesa_setup_nv_temporary_count(GLcontext *ctx, struct gl_program *program) +{ + int i; + + program-NumTemporaries = 0; + for (i = 0; i program-NumInstructions; i++) { + struct prog_instruction *inst = program-Instructions[i]; + + if (inst-DstReg.File == PROGRAM_TEMPORARY) { +program-NumTemporaries = MAX2(program-NumTemporaries, + inst-DstReg.Index + 1); + } + if (inst-SrcReg[0].File == PROGRAM_TEMPORARY) { +program-NumTemporaries = MAX2(program-NumTemporaries, + inst-SrcReg[0].Index + 1); + } + if (inst-SrcReg[1].File == PROGRAM_TEMPORARY) { +program-NumTemporaries = MAX2(program-NumTemporaries, + inst-SrcReg[1].Index + 1); + } + if (inst-SrcReg[2].File == PROGRAM_TEMPORARY) { +program-NumTemporaries = MAX2(program-NumTemporaries, + inst-SrcReg[2].Index + 1); + } + } +} + /** * Load/parse/compile a program. * \note Called from the GL API dispatcher. diff --git a/src/mesa/shader/nvprogram.h b/src/mesa/shader/nvprogram.h index bfac165..0ed143d 100644 --- a/src/mesa/shader/nvprogram.h +++ b/src/mesa/shader/nvprogram.h @@ -103,5 +103,7 @@ extern void GLAPIENTRY _mesa_GetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +extern void +_mesa_setup_nv_temporary_count(GLcontext *ctx, struct gl_program *program); #endif diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index f5e2df2..a94e6b8 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -44,6 +44,7 @@ #include nvprogram.h #include nvvertparse.h #include prog_instruction.h +#include prog_parameter.h #include prog_print.h #include program.h @@ -1345,6 +1346,9 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, if (Parse_Program(parseState, instBuffer)) { + gl_state_index state_tokens[STATE_LENGTH] = {0, 0, 0, 0, 0}; + int i; + /* successful parse! */ if (parseState.isStateProgram) { @@ -1398,6 +1402,27 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, _mesa_fprint_program_opt(stdout, program-Base, PROG_PRINT_NV, 0); _mesa_printf(--\n); #endif + + if (program-Base.Parameters) +_mesa_free_parameter_list(program-Base.Parameters); + + program-Base.Parameters = _mesa_new_parameter_list (); + program-Base.NumParameters = 0; + + state_tokens[0] = STATE_VERTEX_PROGRAM; + state_tokens[1] = STATE_ENV; + /* Add refs to all of the potential params, in order. If we want to not + * upload everything, _mesa_layout_parameters is the answer. + */ + for (i = 0; i MAX_NV_VERTEX_PROGRAM_PARAMS; i++) { +state_tokens[2] = i; +int index = _mesa_add_state_reference(program-Base.Parameters, + state_tokens); +assert(index == i); + } + program-Base.NumParameters = program-Base.Parameters-NumParameters; + + _mesa_setup_nv_temporary_count(ctx, program-Base); } else { /* Error! */ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): i965: Load NV program matrices when required.
Module: Mesa Branch: master Commit: 9018a7dd175caa9a0fbf940b7e66aa9411d2d965 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9018a7dd175caa9a0fbf940b7e66aa9411d2d965 Author: Eric Anholt e...@anholt.net Date: Thu Sep 24 10:40:32 2009 -0700 i965: Load NV program matrices when required. --- src/mesa/drivers/dri/i965/brw_curbe.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c index 0b0e693..4be6c77 100644 --- a/src/mesa/drivers/dri/i965/brw_curbe.c +++ b/src/mesa/drivers/dri/i965/brw_curbe.c @@ -248,6 +248,9 @@ static void prepare_constant_buffer(struct brw_context *brw) GLuint offset = brw-curbe.vs_start * 16; GLuint nr = brw-vs.prog_data-nr_params / 4; + if (brw-vertex_program-IsNVProgram) +_mesa_load_tracked_matrices(ctx); + /* Updates the ParamaterValues[i] pointers for all parameters of the * basic type of PROGRAM_STATE_VAR. */ ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): i965: Remove assert about NV_vp now that it somewhat works.
Module: Mesa Branch: master Commit: a9a47afe7e87075432ce2d393b55409fcb7149ac URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a9a47afe7e87075432ce2d393b55409fcb7149ac Author: Eric Anholt e...@anholt.net Date: Wed Sep 23 16:50:59 2009 -0700 i965: Remove assert about NV_vp now that it somewhat works. --- src/mesa/drivers/dri/i965/brw_vs.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c index e3111c6..f0c79ef 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.c +++ b/src/mesa/drivers/dri/i965/brw_vs.c @@ -90,8 +90,6 @@ static void brw_upload_vs_prog(struct brw_context *brw) struct brw_vertex_program *vp = (struct brw_vertex_program *)brw-vertex_program; - assert (vp !vp-program.IsNVProgram); - memset(key, 0, sizeof(key)); /* Just upload the program verbatim for now. Always send it all ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: added comment
Module: Mesa Branch: master Commit: 964792b0250ece9fe585a4a02544f0e9c4d453a0 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=964792b0250ece9fe585a4a02544f0e9c4d453a0 Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 12:37:06 2009 -0600 mesa: added comment --- src/mesa/shader/prog_parameter.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 6b9e73b..2f029b0 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -100,6 +100,7 @@ _mesa_free_parameter_list(struct gl_program_parameter_list *paramList) * \param type type of parameter, such as * \param name the parameter name, will be duplicated/copied! * \param size number of elements in 'values' vector (1..4, or more) + * \param datatype GL_FLOAT, GL_FLOAT_VECx, GL_INT, GL_INT_VECx or GL_NONE. * \param values initial parameter value, up to 4 GLfloats, or NULL * \param state state indexes, or NULL * \return index of new parameter in the list, or -1 if error (out of mem) ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): i965: Emit zero initialization for NV VP temporaries as required.
Module: Mesa Branch: master Commit: 726a04a2cd1bf159a6c40584b4b2b9bc5948a82e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=726a04a2cd1bf159a6c40584b4b2b9bc5948a82e Author: Eric Anholt e...@anholt.net Date: Thu Sep 24 11:58:33 2009 -0700 i965: Emit zero initialization for NV VP temporaries as required. This is similar to what r300 does inside the driver, but I've added it as a generic option since it seems most hardware will want it. Fixes piglit nv-init-zero-reg.vpfp and nv-init-zero-addr.vpfp. --- src/mesa/drivers/dri/i965/brw_context.c |1 + src/mesa/main/mtypes.h |1 + src/mesa/shader/nvprogram.c | 44 +++ src/mesa/shader/nvprogram.h |4 +++ src/mesa/shader/nvvertparse.c |1 + 5 files changed, 51 insertions(+), 0 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 3c5b848..c300c33 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -125,6 +125,7 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, /* We want the GLSL compiler to emit code that uses condition codes */ ctx-Shader.EmitCondCodes = GL_TRUE; + ctx-Shader.EmitNVTempInitialization = GL_TRUE; ctx-Const.VertexProgram.MaxNativeInstructions = (16 * 1024); ctx-Const.VertexProgram.MaxAluInstructions = 0; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 6b64bf8..f8e4e41 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2079,6 +2079,7 @@ struct gl_shader_state GLboolean EmitContReturn;/** Emit CONT/RET opcodes? */ GLboolean EmitCondCodes; /** Use condition codes? */ GLboolean EmitComments; /** Annotated instructions */ + GLboolean EmitNVTempInitialization; /** 0-fill NV temp registers */ void *MemPool; GLbitfield Flags;/** Mask of GLSL_x flags */ struct gl_sl_pragmas DefaultPragmas; /** Default #pragma settings */ diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index fdb2f42..471a735 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -509,7 +509,51 @@ _mesa_GetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid **pointer) *pointer = (GLvoid *) ctx-Array.ArrayObj-VertexAttrib[index].Ptr; } +void +_mesa_emit_nv_temp_initialization(GLcontext *ctx, + struct gl_program *program) +{ + struct prog_instruction *inst; + int i; + + if (!ctx-Shader.EmitNVTempInitialization) + return; + /* We'll swizzle up a zero temporary so we can use it for the +* ARL. +*/ + if (program-NumTemporaries == 0) + program-NumTemporaries = 1; + + _mesa_insert_instructions(program, 0, program-NumTemporaries + 1); + + for (i = 0; i program-NumTemporaries; i++) { + struct prog_instruction *inst = program-Instructions[i]; + + inst-Opcode = OPCODE_SWZ; + inst-DstReg.File = PROGRAM_TEMPORARY; + inst-DstReg.Index = i; + inst-DstReg.WriteMask = WRITEMASK_XYZW; + inst-SrcReg[0].File = PROGRAM_TEMPORARY; + inst-SrcReg[0].Index = 0; + inst-SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_ZERO, + SWIZZLE_ZERO, + SWIZZLE_ZERO, + SWIZZLE_ZERO); + } + + inst = program-Instructions[i]; + inst-Opcode = OPCODE_ARL; + inst-DstReg.File = PROGRAM_ADDRESS; + inst-DstReg.Index = 0; + inst-DstReg.WriteMask = WRITEMASK_XYZW; + inst-SrcReg[0].File = PROGRAM_TEMPORARY; + inst-SrcReg[0].Index = 0; + inst-SrcReg[0].Swizzle = SWIZZLE_; + + if (program-NumAddressRegs == 0) + program-NumAddressRegs = 1; +} void _mesa_setup_nv_temporary_count(GLcontext *ctx, struct gl_program *program) diff --git a/src/mesa/shader/nvprogram.h b/src/mesa/shader/nvprogram.h index 0ed143d..8ee5966 100644 --- a/src/mesa/shader/nvprogram.h +++ b/src/mesa/shader/nvprogram.h @@ -106,4 +106,8 @@ _mesa_GetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, extern void _mesa_setup_nv_temporary_count(GLcontext *ctx, struct gl_program *program); +extern void +_mesa_emit_nv_temp_initialization(GLcontext *ctx, + struct gl_program *program); + #endif diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index a94e6b8..6ab8a14 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -1423,6 +1423,7 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, program-Base.NumParameters = program-Base.Parameters-NumParameters; _mesa_setup_nv_temporary_count(ctx, program-Base); + _mesa_emit_nv_temp_initialization(ctx, program-Base); } else { /* Error! */ ___
Mesa (master): softpipe: Increase GL_MAX_3D_TEXTURE_SIZE to 256.
Module: Mesa Branch: master Commit: 1730b8db1237485778abdc4ae37e122414b5423b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1730b8db1237485778abdc4ae37e122414b5423b Author: Vinson Lee v...@vmware.com Date: Thu Sep 24 15:59:57 2009 -0600 softpipe: Increase GL_MAX_3D_TEXTURE_SIZE to 256. --- src/gallium/drivers/softpipe/sp_screen.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index cc39d33..2e2668d 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -84,7 +84,7 @@ softpipe_get_param(struct pipe_screen *screen, int param) case PIPE_CAP_MAX_TEXTURE_2D_LEVELS: return 12; /* max 2Kx2K */ case PIPE_CAP_MAX_TEXTURE_3D_LEVELS: - return 8; /* max 128x128x128 */ + return 9; /* max 256x256x256 */ case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS: return 12; /* max 2Kx2K */ case PIPE_CAP_TGSI_CONT_SUPPORTED: ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): Merge branch 'mesa_7_5_branch' into mesa_7_6_branch
Module: Mesa Branch: master Commit: 940ca2e837efe45caae1cf1d9665f6736347705d URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=940ca2e837efe45caae1cf1d9665f6736347705d Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 16:01:26 2009 -0600 Merge branch 'mesa_7_5_branch' into mesa_7_6_branch --- ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): Merge branch 'mesa_7_6_branch'
Module: Mesa Branch: master Commit: 29d27229a95837d085db785a2b4abb654457dafa URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=29d27229a95837d085db785a2b4abb654457dafa Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 16:06:21 2009 -0600 Merge branch 'mesa_7_6_branch' Conflicts: src/mesa/vbo/vbo_exec_array.c --- ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): llvmpipe: increase max 3D texture size to 256
Module: Mesa Branch: master Commit: a665a3416e5a99dc84691c7f113a11190375f340 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a665a3416e5a99dc84691c7f113a11190375f340 Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 16:07:45 2009 -0600 llvmpipe: increase max 3D texture size to 256 --- src/gallium/drivers/llvmpipe/lp_screen.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index ff7ef86..0518927 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -82,7 +82,7 @@ llvmpipe_get_param(struct pipe_screen *screen, int param) case PIPE_CAP_MAX_TEXTURE_2D_LEVELS: return 13; /* max 4Kx4K */ case PIPE_CAP_MAX_TEXTURE_3D_LEVELS: - return 8; /* max 128x128x128 */ + return 9; /* max 256x256x256 */ case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS: return 13; /* max 4Kx4K */ case PIPE_CAP_TGSI_CONT_SUPPORTED: ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): llvmpipe: add missing __FUNCTION__ parameter to debug_printf () calls
Module: Mesa Branch: master Commit: 01249c6d5653a0e66027202f44de2457be5942a5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=01249c6d5653a0e66027202f44de2457be5942a5 Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 16:08:47 2009 -0600 llvmpipe: add missing __FUNCTION__ parameter to debug_printf() calls --- src/gallium/drivers/llvmpipe/lp_bld_arit.c | 12 1 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_bld_arit.c b/src/gallium/drivers/llvmpipe/lp_bld_arit.c index 0b115fc..3143331 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_arit.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_arit.c @@ -918,7 +918,8 @@ lp_build_pow(struct lp_build_context *bld, { /* TODO: optimize the constant case */ if(LLVMIsConstant(x) LLVMIsConstant(y)) - debug_printf(%s: inefficient/imprecise constant arithmetic\n); + debug_printf(%s: inefficient/imprecise constant arithmetic\n, + __FUNCTION__); return lp_build_exp2(bld, lp_build_mul(bld, lp_build_log2(bld, x), y)); } @@ -972,7 +973,8 @@ lp_build_polynomial(struct lp_build_context *bld, /* TODO: optimize the constant case */ if(LLVMIsConstant(x)) - debug_printf(%s: inefficient/imprecise constant arithmetic\n); + debug_printf(%s: inefficient/imprecise constant arithmetic\n, + __FUNCTION__); for (i = num_coeffs; i--; ) { LLVMValueRef coeff = lp_build_const_scalar(type, coeffs[i]); @@ -1026,7 +1028,8 @@ lp_build_exp2_approx(struct lp_build_context *bld, if(p_exp2_int_part || p_frac_part || p_exp2) { /* TODO: optimize the constant case */ if(LLVMIsConstant(x)) - debug_printf(%s: inefficient/imprecise constant arithmetic\n); + debug_printf(%s: inefficient/imprecise constant arithmetic\n, + __FUNCTION__); assert(type.floating type.width == 32); @@ -1125,7 +1128,8 @@ lp_build_log2_approx(struct lp_build_context *bld, if(p_exp || p_floor_log2 || p_log2) { /* TODO: optimize the constant case */ if(LLVMIsConstant(x)) - debug_printf(%s: inefficient/imprecise constant arithmetic\n); + debug_printf(%s: inefficient/imprecise constant arithmetic\n, + __FUNCTION__); assert(type.floating type.width == 32); ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): st/xorg: add easier way of disabling/enabling acceleration
Module: Mesa Branch: master Commit: 53d2fa46e7fa19d0cb7dec74efcd407ab6163c80 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=53d2fa46e7fa19d0cb7dec74efcd407ab6163c80 Author: Zack Rusin za...@vmware.com Date: Wed Sep 23 09:00:58 2009 -0400 st/xorg: add easier way of disabling/enabling acceleration --- src/gallium/state_trackers/xorg/xorg_composite.c |5 +-- src/gallium/state_trackers/xorg/xorg_exa.c | 23 +++-- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/gallium/state_trackers/xorg/xorg_composite.c b/src/gallium/state_trackers/xorg/xorg_composite.c index a870ad1..bb50289 100644 --- a/src/gallium/state_trackers/xorg/xorg_composite.c +++ b/src/gallium/state_trackers/xorg/xorg_composite.c @@ -388,7 +388,7 @@ bind_viewport_state(struct exa_context *exa, struct exa_pixmap_priv *pDst) int width = pDst-tex-width[0]; int height = pDst-tex-height[0]; - debug_printf(Bind viewport (%d, %d)\n, width, height); + /*debug_printf(Bind viewport (%d, %d)\n, width, height);*/ set_viewport(exa, width, height, Y0_TOP); } @@ -672,7 +672,7 @@ boolean xorg_solid_bind_state(struct exa_context *exa, cso_set_vertex_shader_handle(exa-cso, shader.vs); cso_set_fragment_shader_handle(exa-cso, shader.fs); - return FALSE; + return TRUE; } void xorg_solid(struct exa_context *exa, @@ -701,7 +701,6 @@ void xorg_solid(struct exa_context *exa, if (buf) { - debug_printf(Drawing buf is %p\n, buf); util_draw_vertex_buffer(pipe, buf, 0, PIPE_PRIM_TRIANGLE_FAN, 4, /* verts */ diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index 6507b29..deae9d8 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -48,6 +48,7 @@ #include util/u_rect.h #define DEBUG_SOLID 0 +#define DISABLE_ACCEL 1 /* * Helper functions @@ -281,8 +282,8 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg) struct exa_pixmap_priv *priv = exaGetPixmapDriverPrivate(pPixmap); struct exa_context *exa = ms-exa; -#if 0 -debug_printf(ExaPrepareSolid - test\n); +#if 1 +debug_printf(ExaPrepareSolid(0x%x)\n, fg); #endif if (!EXA_PM_IS_SOLID(pPixmap-drawable, planeMask)) return FALSE; @@ -306,11 +307,11 @@ ExaPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planeMask, Pixel fg) fg = 0x; #endif -#if 1 -debug_printf( ExaPrepareSolid(0x%x)\n, fg); -#endif - +#if DISABLE_ACCEL +return FALSE; +#else return xorg_solid_bind_state(exa, priv, fg); +#endif } static void @@ -403,8 +404,11 @@ ExaPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, exa-copy.src = src_priv; exa-copy.dst = priv; -/*XXX disabled until some issues with syncing are fixed */ +#if DISABLE_ACCEL return FALSE; +#else +return TRUE; +#endif } static void @@ -437,11 +441,16 @@ ExaPrepareComposite(int op, PicturePtr pSrcPicture, debug_printf(ExaPrepareComposite\n); +#if DISABLE_ACCEL + (void) exa; + return FALSE; +#else return xorg_composite_bind_state(exa, op, pSrcPicture, pMaskPicture, pDstPicture, exaGetPixmapDriverPrivate(pSrc), exaGetPixmapDriverPrivate(pMask), exaGetPixmapDriverPrivate(pDst)); +#endif } static void ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): st/xorg: fills are supported plussome minor clenups
Module: Mesa Branch: master Commit: 80965fca743c3101af731080cb81dec705cd931b URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=80965fca743c3101af731080cb81dec705cd931b Author: Zack Rusin za...@vmware.com Date: Wed Sep 23 12:06:13 2009 -0400 st/xorg: fills are supported plussome minor clenups --- src/gallium/state_trackers/xorg/xorg_composite.c |7 --- src/gallium/state_trackers/xorg/xorg_exa.c | 11 +++ 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/src/gallium/state_trackers/xorg/xorg_composite.c b/src/gallium/state_trackers/xorg/xorg_composite.c index bb50289..f8a3d7b 100644 --- a/src/gallium/state_trackers/xorg/xorg_composite.c +++ b/src/gallium/state_trackers/xorg/xorg_composite.c @@ -305,17 +305,10 @@ boolean xorg_composite_accelerated(int op, unsigned accel_ops_count = sizeof(accelerated_ops)/sizeof(struct acceleration_info); - - /*FIXME: currently accel is disabled */ - return FALSE; - if (pSrcPicture) { /* component alpha not supported */ if (pSrcPicture-componentAlpha) return FALSE; - /* fills not supported */ - if (pSrcPicture-pSourcePict) - return FALSE; } for (i = 0; i accel_ops_count; ++i) { diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index deae9d8..1bb274e 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -473,10 +473,13 @@ ExaCheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture, PicturePtr pDstPicture) { - return xorg_composite_accelerated(op, - pSrcPicture, - pMaskPicture, - pDstPicture); + boolean accelerated = xorg_composite_accelerated(op, +pSrcPicture, +pMaskPicture, +pDstPicture); + debug_printf(ExaCheckComposite(%d, %p, %p, %p) = %d\n, +op, pSrcPicture, pMaskPicture, pDstPicture, accelerated); + return accelerated; } static void * ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): st/xorg: start working on the Xv acceleration code
Module: Mesa Branch: master Commit: 228aa45fcbb65205937f74853801643d676db675 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=228aa45fcbb65205937f74853801643d676db675 Author: Zack Rusin za...@vmware.com Date: Thu Sep 24 19:20:08 2009 -0400 st/xorg: start working on the Xv acceleration code --- src/gallium/state_trackers/xorg/xorg_tracker.h |6 + src/gallium/state_trackers/xorg/xorg_xv.c | 212 2 files changed, 218 insertions(+), 0 deletions(-) diff --git a/src/gallium/state_trackers/xorg/xorg_tracker.h b/src/gallium/state_trackers/xorg/xorg_tracker.h index b1ab783..2f7050b 100644 --- a/src/gallium/state_trackers/xorg/xorg_tracker.h +++ b/src/gallium/state_trackers/xorg/xorg_tracker.h @@ -151,5 +151,11 @@ crtc_cursor_destroy(xf86CrtcPtr crtc); void output_init(ScrnInfoPtr pScrn); +/*** + * xorg_xv.c + */ +void +xorg_init_video(ScreenPtr pScreen); + #endif /* _XORG_TRACKER_H_ */ diff --git a/src/gallium/state_trackers/xorg/xorg_xv.c b/src/gallium/state_trackers/xorg/xorg_xv.c new file mode 100644 index 000..88955d4 --- /dev/null +++ b/src/gallium/state_trackers/xorg/xorg_xv.c @@ -0,0 +1,212 @@ +#include xorg_tracker.h + +#include xf86xv.h +#include X11/extensions/Xv.h +#include fourcc.h + +/*XXX get these from pipe's texture limits */ +#define IMAGE_MAX_WIDTH2048 +#define IMAGE_MAX_HEIGHT 2048 + +#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) + +static Atom xvBrightness, xvContrast; + +#define NUM_TEXTURED_ATTRIBUTES 2 +static XF86AttributeRec TexturedAttributes[NUM_TEXTURED_ATTRIBUTES] = { + {XvSettable | XvGettable, -128, 127, XV_BRIGHTNESS}, + {XvSettable | XvGettable, 0, 255, XV_CONTRAST} +}; + +#define NUM_FORMATS 3 +static XF86VideoFormatRec Formats[NUM_FORMATS] = { + {15, TrueColor}, {16, TrueColor}, {24, TrueColor} +}; + +static XF86VideoEncodingRec DummyEncoding[1] = { + { + 0, + XV_IMAGE, + IMAGE_MAX_WIDTH, IMAGE_MAX_HEIGHT, + {1, 1} + } +}; + +#define NUM_IMAGES 2 +static XF86ImageRec Images[NUM_IMAGES] = { + XVIMAGE_UYVY, + XVIMAGE_YUY2, +}; + +struct xorg_xv_port_priv { + RegionRec clip; +}; + + +static void +stop_video(ScrnInfoPtr pScrn, pointer data, Bool shutdown) +{ +} + +static int +set_port_attribute(ScrnInfoPtr pScrn, + Atom attribute, INT32 value, pointer data) +{ + return 0; +} + +static int +get_port_attribute(ScrnInfoPtr pScrn, + Atom attribute, INT32 * value, pointer data) +{ + return 0; +} + +static void +query_best_size(ScrnInfoPtr pScrn, +Bool motion, +short vid_w, short vid_h, +short drw_w, short drw_h, +unsigned int *p_w, unsigned int *p_h, pointer data) +{ +} + +static int +put_image(ScrnInfoPtr pScrn, + short src_x, short src_y, + short drw_x, short drw_y, + short src_w, short src_h, + short drw_w, short drw_h, + int id, unsigned char *buf, + short width, short height, + Bool sync, RegionPtr clipBoxes, pointer data, + DrawablePtr pDraw) +{ + return 0; +} + +static int +query_image_attributes(ScrnInfoPtr pScrn, + int id, + unsigned short *w, unsigned short *h, + int *pitches, int *offsets) +{ + return 0; +} + +static struct xorg_xv_port_priv * +port_priv_create(ScreenPtr pScreen) +{ + /*ScrnInfoPtr pScrn = xf86Screens[pScreen-myNum];*/ + /*modesettingPtr ms = modesettingPTR(pScrn);*/ + struct xorg_xv_port_priv *priv = NULL; + + priv = calloc(1, sizeof(struct xorg_xv_port_priv)); + + if (!priv) + return NULL; + +REGION_NULL(pScreen, priv-clip); + + return priv; +} + +static XF86VideoAdaptorPtr +xorg_setup_textured_adapter(ScreenPtr pScreen) +{ + /*ScrnInfoPtr pScrn = xf86Screens[pScreen-myNum];*/ + /*modesettingPtr ms = modesettingPTR(pScrn);*/ + XF86VideoAdaptorPtr adapt; + XF86AttributePtr attrs; + DevUnion *dev_unions; + int nports = 16, i; + int nattributes; + + nattributes = NUM_TEXTURED_ATTRIBUTES; + + adapt = calloc(1, sizeof(XF86VideoAdaptorRec)); + dev_unions = calloc(nports, sizeof(DevUnion)); + attrs = calloc(nattributes, sizeof(XF86AttributeRec)); + if (adapt == NULL || dev_unions == NULL || attrs == NULL) { + free(adapt); + free(dev_unions); + free(attrs); + return NULL; + } + + adapt-type = XvWindowMask | XvInputMask | XvImageMask; + adapt-flags = 0; + adapt-name = Gallium3D Textured Video; + adapt-nEncodings = 1; + adapt-pEncodings = DummyEncoding; + adapt-nFormats = NUM_FORMATS; + adapt-pFormats = Formats; + adapt-nPorts = 0; + adapt-pPortPrivates = dev_unions; + adapt-nAttributes = nattributes; + adapt-pAttributes = attrs; + memcpy(attrs, TexturedAttributes, nattributes * sizeof(XF86AttributeRec)); + adapt-nImages = NUM_IMAGES; +
Mesa (mesa_7_6_branch): intel: Flush the batch when we' re about to subdata into a VBO.
Module: Mesa Branch: mesa_7_6_branch Commit: cc8084932cc552587e3036dbbf62c77db3b4a08e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cc8084932cc552587e3036dbbf62c77db3b4a08e Author: Eric Anholt e...@anholt.net Date: Thu Sep 24 16:15:52 2009 -0700 intel: Flush the batch when we're about to subdata into a VBO. This fixes the clears in openarena with the new metaops clear code, and the new piglit vbo-subdata-sync test. Bug #23857. --- src/mesa/drivers/dri/intel/intel_buffer_objects.c |6 +- src/mesa/drivers/dri/intel/intel_clear.c |1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index c55c5c4..7f6fb66 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -207,8 +207,12 @@ intel_bufferobj_subdata(GLcontext * ctx, if (intel_obj-sys_buffer) memcpy((char *)intel_obj-sys_buffer + offset, data, size); - else + else { + /* Flush any existing batchbuffer that might reference this data. */ + intelFlush(ctx); + dri_bo_subdata(intel_obj-buffer, offset, size, data); + } } diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index 9010b91..1b0e221 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -173,7 +173,6 @@ intelClear(GLcontext *ctx, GLbitfield mask) } _mesa_meta_clear(intel-ctx, tri_mask); - intel_batchbuffer_flush(intel-batch); } if (swrast_mask) { ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (mesa_7_6_branch): i965: Clean up some mess with the batch cache.
Module: Mesa Branch: mesa_7_6_branch Commit: 54107a097904129ff794534542acd09ed152ea2e URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=54107a097904129ff794534542acd09ed152ea2e Author: Eric Anholt e...@anholt.net Date: Thu Sep 24 14:53:49 2009 -0700 i965: Clean up some mess with the batch cache. Its flagging of extra state that's already flagged by the vtbl new_batch when appropriate was confusing my tracking down of the OA clear bug. --- src/mesa/drivers/dri/i965/brw_state.h|5 + src/mesa/drivers/dri/i965/brw_state_batch.c | 15 ++- src/mesa/drivers/dri/i965/brw_state_upload.c |3 ++- 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index 7857235..5335eac 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -86,9 +86,6 @@ const struct brw_tracked_state brw_psp_urb_cbs; const struct brw_tracked_state brw_pipe_control; -const struct brw_tracked_state brw_clear_surface_cache; -const struct brw_tracked_state brw_clear_batch_cache; - const struct brw_tracked_state brw_drawing_rect; const struct brw_tracked_state brw_indices; const struct brw_tracked_state brw_vertices; @@ -165,7 +162,7 @@ GLboolean brw_cached_batch_struct( struct brw_context *brw, const void *data, GLuint sz ); void brw_destroy_batch_cache( struct brw_context *brw ); -void brw_clear_batch_cache_flush( struct brw_context *brw ); +void brw_clear_batch_cache( struct brw_context *brw ); /* brw_wm_surface_state.c */ dri_bo * diff --git a/src/mesa/drivers/dri/i965/brw_state_batch.c b/src/mesa/drivers/dri/i965/brw_state_batch.c index 811940e..7821898 100644 --- a/src/mesa/drivers/dri/i965/brw_state_batch.c +++ b/src/mesa/drivers/dri/i965/brw_state_batch.c @@ -79,7 +79,7 @@ GLboolean brw_cached_batch_struct( struct brw_context *brw, return GL_TRUE; } -static void clear_batch_cache( struct brw_context *brw ) +void brw_clear_batch_cache( struct brw_context *brw ) { struct brw_cached_batch_item *item = brw-cached_batch_items; @@ -93,18 +93,7 @@ static void clear_batch_cache( struct brw_context *brw ) brw-cached_batch_items = NULL; } -void brw_clear_batch_cache_flush( struct brw_context *brw ) -{ - clear_batch_cache(brw); - - brw-state.dirty.mesa |= ~0; - brw-state.dirty.brw |= ~0; - brw-state.dirty.cache |= ~0; -} - - - void brw_destroy_batch_cache( struct brw_context *brw ) { - clear_batch_cache(brw); + brw_clear_batch_cache(brw); } diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 414620d..b817b74 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -287,6 +287,7 @@ void brw_validate_state( struct brw_context *brw ) if (brw-emit_state_always) { state-mesa |= ~0; state-brw |= ~0; + state-cache |= ~0; } if (brw-fragment_program != ctx-FragmentProgram._Current) { @@ -305,7 +306,7 @@ void brw_validate_state( struct brw_context *brw ) return; if (brw-state.dirty.brw BRW_NEW_CONTEXT) - brw_clear_batch_cache_flush(brw); + brw_clear_batch_cache(brw); brw-intel.Fallback = 0; ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa: _mesa_meta_GenerateMipmap() now working
Module: Mesa Branch: master Commit: 0876618a8d118b39b80963cc0d5e7a118961aa83 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0876618a8d118b39b80963cc0d5e7a118961aa83 Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 19:33:22 2009 -0600 mesa: _mesa_meta_GenerateMipmap() now working Handles GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP. But GL_TEXTURE_3D and texture borders not supported yet. --- src/mesa/drivers/common/meta.c | 205 +--- 1 files changed, 172 insertions(+), 33 deletions(-) diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 2175678..b445323 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -1939,6 +1939,10 @@ _mesa_meta_Bitmap(GLcontext *ctx, } +/** + * Called via ctx-Driver.GenerateMipmap() + * Note: texture borders and 3D texture support not yet complete. + */ void _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, struct gl_texture_object *texObj) @@ -1952,13 +1956,20 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, const GLuint maxLevel = texObj-MaxLevel; const GLenum minFilterSave = texObj-MinFilter; const GLenum magFilterSave = texObj-MagFilter; + const GLint baseLevelSave = texObj-BaseLevel; + const GLint maxLevelSave = texObj-MaxLevel; + const GLboolean genMipmapSave = texObj-GenerateMipmap; + const GLenum wrapSSave = texObj-WrapS; + const GLenum wrapTSave = texObj-WrapT; + const GLenum wrapRSave = texObj-WrapR; const GLuint fboSave = ctx-DrawBuffer-Name; GLenum faceTarget; - GLuint level; + GLuint dstLevel; GLuint border = 0; /* check for fallbacks */ - if (!ctx-Extensions.EXT_framebuffer_object) { + if (!ctx-Extensions.EXT_framebuffer_object || + target == GL_TEXTURE_3D) { _mesa_generate_mipmap(ctx, target, texObj); return; } @@ -2007,12 +2018,16 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR); _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + _mesa_TexParameteri(target, GL_GENERATE_MIPMAP, GL_FALSE); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); + _mesa_set_enable(ctx, target, GL_TRUE); /* setup texcoords once (XXX what about border?) */ switch (faceTarget) { - case GL_TEXTURE_CUBE_MAP_POSITIVE_X: - break; + case GL_TEXTURE_1D: case GL_TEXTURE_2D: verts[0].s = 0.0F; verts[0].t = 0.0F; @@ -2027,63 +2042,180 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, verts[3].t = 1.0F; verts[3].r = 0.0F; break; + case GL_TEXTURE_3D: + abort(); + break; + default: + /* cube face */ + { + static const GLfloat st[4][2] = { +{0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f} + }; + GLuint i; + + /* loop over quad verts */ + for (i = 0; i 4; i++) { +/* Compute sc = +/-scale and tc = +/-scale. + * Not +/-1 to avoid cube face selection ambiguity near the edges, + * though that can still sometimes happen with this scale factor... + */ +const GLfloat scale = 0.f; +const GLfloat sc = (2.0f * st[i][0] - 1.0f) * scale; +const GLfloat tc = (2.0f * st[i][1] - 1.0f) * scale; + +switch (faceTarget) { +case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + verts[i].s = 1.0f; + verts[i].t = -tc; + verts[i].r = -sc; + break; +case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + verts[i].s = -1.0f; + verts[i].t = -tc; + verts[i].r = sc; + break; +case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + verts[i].s = sc; + verts[i].t = 1.0f; + verts[i].r = tc; + break; +case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + verts[i].s = sc; + verts[i].t = -1.0f; + verts[i].r = -tc; + break; +case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + verts[i].s = sc; + verts[i].t = -tc; + verts[i].r = 1.0f; + break; +case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + verts[i].s = -sc; + verts[i].t = -tc; + verts[i].r = -1.0f; + break; +default: + assert(0); +} + } + } } + _mesa_set_enable(ctx, target, GL_TRUE); + + /* texture is already locked, unlock now */ + _mesa_unlock_texture(ctx, texObj); - for (level = baseLevel + 1; level = maxLevel; level++) { + for (dstLevel = baseLevel +
Mesa (master): progs/perf: glGenerateMipmap() test
Module: Mesa Branch: master Commit: c9ddd6f810ce016cabf232c53ffca186ef885140 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c9ddd6f810ce016cabf232c53ffca186ef885140 Author: Brian Paul bri...@vmware.com Date: Thu Sep 24 19:36:37 2009 -0600 progs/perf: glGenerateMipmap() test --- progs/perf/Makefile|1 + progs/perf/SConscript |1 + progs/perf/genmipmap.c | 136 3 files changed, 138 insertions(+), 0 deletions(-) diff --git a/progs/perf/Makefile b/progs/perf/Makefile index 043e91d..066eb86 100644 --- a/progs/perf/Makefile +++ b/progs/perf/Makefile @@ -18,6 +18,7 @@ PROG_SOURCES = \ drawoverhead.c \ fbobind.c \ fill.c \ + genmipmap.c \ readpixels.c \ swapbuffers.c \ teximage.c \ diff --git a/progs/perf/SConscript b/progs/perf/SConscript index 84f1669..a5ec9a7 100644 --- a/progs/perf/SConscript +++ b/progs/perf/SConscript @@ -12,6 +12,7 @@ progs = [ 'drawoverhead', 'fbobind', 'fill', + 'genmipmap', 'readpixels', 'swapbuffers', 'teximage', diff --git a/progs/perf/genmipmap.c b/progs/perf/genmipmap.c new file mode 100644 index 000..4b7d6ad --- /dev/null +++ b/progs/perf/genmipmap.c @@ -0,0 +1,136 @@ +/* + * Copyright (C) 2009 VMware, Inc. 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, sublicense, + * 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 above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * 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 NONINFRINGEMENT. IN NO EVENT SHALL + * VMWARE 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. + */ + +/** + * Measure glGenerateMipmap() speed. + * + * Brian Paul + * 24 Sep 2009 + */ + +#include string.h +#include glmain.h +#include common.h + + +int WinWidth = 100, WinHeight = 100; + +static GLboolean DrawPoint = GL_TRUE; +static GLuint VBO; +static GLuint TexObj = 0; +static GLint BaseLevel, MaxLevel; + +struct vertex +{ + GLfloat x, y, s, t; +}; + +static const struct vertex vertices[1] = { + { 0.0, 0.0, 0.5, 0.5 }, +}; + +#define VOFFSET(F) ((void *) offsetof(struct vertex, F)) + +/** Called from test harness/main */ +void +PerfInit(void) +{ + /* setup VBO w/ vertex data */ + glGenBuffersARB(1, VBO); + glBindBufferARB(GL_ARRAY_BUFFER_ARB, VBO); + glBufferDataARB(GL_ARRAY_BUFFER_ARB, + sizeof(vertices), vertices, GL_STATIC_DRAW_ARB); + glVertexPointer(2, GL_FLOAT, sizeof(struct vertex), VOFFSET(x)); + glTexCoordPointer(2, GL_FLOAT, sizeof(struct vertex), VOFFSET(s)); + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + + glGenTextures(1, TexObj); + glBindTexture(GL_TEXTURE_2D, TexObj); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glEnable(GL_TEXTURE_2D); +} + + +static void +GenMipmap(unsigned count) +{ + unsigned i; + for (i = 0; i count; i++) { + GLubyte texel[4]; + texel[0] = texel[1] = texel[2] = texel[3] = i 0xff; + /* dirty the base image */ + glTexSubImage2D(GL_TEXTURE_2D, BaseLevel, + 0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, texel); + glGenerateMipmap(GL_TEXTURE_2D); + if (DrawPoint) + glDrawArrays(GL_POINTS, 0, 1); + } + glFinish(); +} + + +/** Called from test harness/main */ +void +PerfNextRound(void) +{ +} + + +/** Called from test harness/main */ +void +PerfDraw(void) +{ + const GLint NumLevels = 12; + const GLint TexWidth = 2048, TexHeight = 2048; + GLubyte *img; + double rate; + + /* Make 2K x 2K texture */ + img = (GLubyte *) malloc(TexWidth * TexHeight * 4); + memset(img, 128, TexWidth * TexHeight * 4); + glTexImage2D(GL_TEXTURE_2D, 0, +GL_RGBA, TexWidth, TexHeight, 0, +GL_RGBA, GL_UNSIGNED_BYTE, img); + free(img); + + perf_printf(Texture level[0] size: %d x %d, %d levels\n, + TexWidth, TexHeight, NumLevels); + + /* loop over base levels 0, 2, 4 */ + for (BaseLevel = 0; BaseLevel = 4; BaseLevel += 2) { + + /* loop over max level */ + for (MaxLevel = NumLevels; MaxLevel BaseLevel;
Mesa (mesa_7_5_branch): i915: Fix GetBufferSubData in the case of a system-memory BO.
Module: Mesa Branch: mesa_7_5_branch Commit: 126d62edd18f22ff9e744efea81e0383cd0a19c5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=126d62edd18f22ff9e744efea81e0383cd0a19c5 Author: Eric Anholt e...@anholt.net Date: Thu Sep 24 20:03:21 2009 -0700 i915: Fix GetBufferSubData in the case of a system-memory BO. Bug #23760 (crashes in wine) --- src/mesa/drivers/dri/intel/intel_buffer_objects.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index 2e6b778..db0de03 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -209,7 +209,10 @@ intel_bufferobj_get_subdata(GLcontext * ctx, struct intel_buffer_object *intel_obj = intel_buffer_object(obj); assert(intel_obj); - dri_bo_get_subdata(intel_obj-buffer, offset, size, data); + if (intel_obj-sys_buffer) + memcpy(data, (char *)intel_obj-sys_buffer + offset, size); + else + dri_bo_get_subdata(intel_obj-buffer, offset, size, data); } ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa/main: Add comments to mfeatures.h.
Module: Mesa Branch: master Commit: 17099f5e19dc0ce65cb4e4110d9d22de803c4e52 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=17099f5e19dc0ce65cb4e4110d9d22de803c4e52 Author: Chia-I Wu olva...@gmail.com Date: Mon Sep 7 17:51:33 2009 +0800 mesa/main: Add comments to mfeatures.h. The comments document the conventions that a feature may follow. --- src/mesa/main/mfeatures.h | 32 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h index e23cdb1..6318934 100644 --- a/src/mesa/main/mfeatures.h +++ b/src/mesa/main/mfeatures.h @@ -36,6 +36,38 @@ #define _HAVE_FULL_GL 1 #endif +/* assert that a feature is disabled and should never be used */ +#define ASSERT_NO_FEATURE() ASSERT(0) + +/** + * A feature can be anything. But most of them share certain characteristics. + * + * When a feature defines driver entries, they can be initialized by + * _MESA_INIT_FEATURE_FUNCTIONS + * + * When a feature defines vtxfmt entries, they can be initialized and + * installed by + * _MESA_INIT_FEATURE_VTXFMT + * _mesa_install_feature_vtxfmt + * + * When a feature defines dispatch entries, they are initialized by + * _mesa_init_feature_dispatch + * + * When a feature has states, they are initialized and freed by + * _mesa_init_feature + * _mesa_free_feature_data + * + * Except for states, the others compile to no-op when a feature is disabled. + * + * The GLAPIENTRYs and helper functions defined by a feature should also + * compile to no-op when it is disabled. But to save typings and to catch + * bugs, some of them may be unavailable, or compile to ASSERT_NO_FEATURE() + * when the feature is disabled. + * + * A feature following the conventions may be used without knowing if it is + * enabled or not. + */ + #define FEATURE_accum _HAVE_FULL_GL #define FEATURE_attrib_stack _HAVE_FULL_GL #define FEATURE_colortable _HAVE_FULL_GL ___ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit
Mesa (master): mesa/main: Make FEATURE_convolve follow feature conventions.
Module: Mesa Branch: master Commit: 5a1e25afac8eac5df1c0c9d3165b9812f54909a6 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=5a1e25afac8eac5df1c0c9d3165b9812f54909a6 Author: Chia-I Wu olva...@gmail.com Date: Wed Sep 23 16:56:20 2009 +0800 mesa/main: Make FEATURE_convolve follow feature conventions. As shown in mfeatures.h, this allows users of convolve.h to work without knowing if the feature is available. --- src/mesa/main/api_exec.c | 19 +--- src/mesa/main/convolve.c | 48 ++ src/mesa/main/convolve.h | 118 +- src/mesa/main/teximage.c |2 - src/mesa/main/texstore.c |2 - 5 files changed, 103 insertions(+), 86 deletions(-) diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index 30c142e..6317639 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -56,9 +56,7 @@ #include clip.h #include colortab.h #include context.h -#if FEATURE_convolve #include convolve.h -#endif #include depth.h #if FEATURE_dlist #include dlist.h @@ -384,21 +382,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT); _mesa_init_colortable_dispatch(exec); - -#if FEATURE_convolve - SET_ConvolutionFilter1D(exec, _mesa_ConvolutionFilter1D); - SET_ConvolutionFilter2D(exec, _mesa_ConvolutionFilter2D); - SET_ConvolutionParameterf(exec, _mesa_ConvolutionParameterf); - SET_ConvolutionParameterfv(exec, _mesa_ConvolutionParameterfv); - SET_ConvolutionParameteri(exec, _mesa_ConvolutionParameteri); - SET_ConvolutionParameteriv(exec, _mesa_ConvolutionParameteriv); - SET_CopyConvolutionFilter1D(exec, _mesa_CopyConvolutionFilter1D); - SET_CopyConvolutionFilter2D(exec, _mesa_CopyConvolutionFilter2D); - SET_GetConvolutionFilter(exec, _mesa_GetConvolutionFilter); - SET_GetConvolutionParameterfv(exec, _mesa_GetConvolutionParameterfv); - SET_GetConvolutionParameteriv(exec, _mesa_GetConvolutionParameteriv); - SET_SeparableFilter2D(exec, _mesa_SeparableFilter2D); -#endif + _mesa_init_convolve_dispatch(exec); #if FEATURE_histogram SET_GetHistogram(exec, _mesa_GetHistogram); SET_GetHistogramParameterfv(exec, _mesa_GetHistogramParameterfv); @@ -406,7 +390,6 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_GetMinmax(exec, _mesa_GetMinmax); SET_GetMinmaxParameterfv(exec, _mesa_GetMinmaxParameterfv); SET_GetMinmaxParameteriv(exec, _mesa_GetMinmaxParameteriv); - SET_GetSeparableFilter(exec, _mesa_GetSeparableFilter); SET_Histogram(exec, _mesa_Histogram); SET_Minmax(exec, _mesa_Minmax); SET_ResetHistogram(exec, _mesa_ResetHistogram); diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c index bf6f661..8db3e79 100644 --- a/src/mesa/main/convolve.c +++ b/src/mesa/main/convolve.c @@ -40,6 +40,10 @@ #include mtypes.h #include pixel.h #include state.h +#include glapi/dispatch.h + + +#if FEATURE_convolve /* @@ -256,7 +260,7 @@ _mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, G } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) { GET_CURRENT_CONTEXT(ctx); @@ -299,7 +303,7 @@ _mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -351,7 +355,7 @@ _mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) { GET_CURRENT_CONTEXT(ctx); @@ -394,7 +398,7 @@ _mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) { GET_CURRENT_CONTEXT(ctx); @@ -459,7 +463,7 @@ _mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width) { GLint baseFormat; @@ -491,7 +495,7 @@ _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLi } -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height) { GLint baseFormat; @@ -527,7 +531,7 @@ _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLi } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image) { @@ -586,7 +590,7 @@ _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, } -void GLAPIENTRY +static void GLAPIENTRY
Mesa (master): mesa/main: Make FEATURE_colortable follow feature conventions.
Module: Mesa Branch: master Commit: cb4f24e51d0f4f4b867b2c01ed26d2a5ce73aeab URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=cb4f24e51d0f4f4b867b2c01ed26d2a5ce73aeab Author: Chia-I Wu olva...@gmail.com Date: Mon Sep 7 17:17:11 2009 +0800 mesa/main: Make FEATURE_colortable follow feature conventions. As shown in mfeatures.h, this allows users of colortab.h to work without knowing if the feature is available. --- src/mesa/main/api_exec.c | 14 + src/mesa/main/colortab.c | 37 +++ src/mesa/main/colortab.h | 71 + src/mesa/main/context.c |6 src/mesa/main/texobj.c |4 -- src/mesa/main/texstate.c |6 6 files changed, 64 insertions(+), 74 deletions(-) diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index 39941a1..30c142e 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -54,9 +54,7 @@ #endif #include clear.h #include clip.h -#if FEATURE_colortable #include colortab.h -#endif #include context.h #if FEATURE_convolve #include convolve.h @@ -385,17 +383,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_BlendEquation(exec, _mesa_BlendEquation); SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT); -#if FEATURE_colortable - SET_ColorSubTable(exec, _mesa_ColorSubTable); - SET_ColorTable(exec, _mesa_ColorTable); - SET_ColorTableParameterfv(exec, _mesa_ColorTableParameterfv); - SET_ColorTableParameteriv(exec, _mesa_ColorTableParameteriv); - SET_CopyColorSubTable(exec, _mesa_CopyColorSubTable); - SET_CopyColorTable(exec, _mesa_CopyColorTable); - SET_GetColorTable(exec, _mesa_GetColorTable); - SET_GetColorTableParameterfv(exec, _mesa_GetColorTableParameterfv); - SET_GetColorTableParameteriv(exec, _mesa_GetColorTableParameteriv); -#endif + _mesa_init_colortable_dispatch(exec); #if FEATURE_convolve SET_ConvolutionFilter1D(exec, _mesa_ConvolutionFilter1D); diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 5447eb1..5ede76c 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -32,6 +32,10 @@ #include state.h #include teximage.h #include texstate.h +#include glapi/dispatch.h + + +#if FEATURE_colortable /** @@ -536,7 +540,7 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) { @@ -552,7 +556,7 @@ _mesa_CopyColorTable(GLenum target, GLenum internalformat, -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) { @@ -568,7 +572,7 @@ _mesa_CopyColorSubTable(GLenum target, GLsizei start, -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetColorTable( GLenum target, GLenum format, GLenum type, GLvoid *data ) { @@ -702,7 +706,7 @@ _mesa_GetColorTable( GLenum target, GLenum format, -void GLAPIENTRY +static void GLAPIENTRY _mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) { GLfloat *scale, *bias; @@ -747,7 +751,7 @@ _mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) -void GLAPIENTRY +static void GLAPIENTRY _mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) { GLfloat fparams[4]; @@ -770,7 +774,7 @@ _mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) { GET_CURRENT_CONTEXT(ctx); @@ -897,7 +901,7 @@ _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) { GET_CURRENT_CONTEXT(ctx); @@ -1052,6 +1056,25 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) } } + +void +_mesa_init_colortable_dispatch(struct _glapi_table *disp) +{ + SET_ColorSubTable(disp, _mesa_ColorSubTable); + SET_ColorTable(disp, _mesa_ColorTable); + SET_ColorTableParameterfv(disp, _mesa_ColorTableParameterfv); + SET_ColorTableParameteriv(disp, _mesa_ColorTableParameteriv); + SET_CopyColorSubTable(disp, _mesa_CopyColorSubTable); + SET_CopyColorTable(disp, _mesa_CopyColorTable); + SET_GetColorTable(disp, _mesa_GetColorTable); + SET_GetColorTableParameterfv(disp, _mesa_GetColorTableParameterfv); + SET_GetColorTableParameteriv(disp, _mesa_GetColorTableParameteriv); +} + + +#endif /* FEATURE_colortable */ + + /**/ /* Initialization*/ /**/ diff --git