diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2021-07-22 10:50:50 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2021-07-22 10:50:50 +0000 |
commit | 9130ec005fbc78a62420643414d8354d0929ca50 (patch) | |
tree | 6762777acdd2d4eee17ef87290e80dc7afe2b73d /lib/mesa/src/gallium/tests/graw | |
parent | ca11beabae33eb59fb981b8adf50b1d47a2a98f0 (diff) |
Merge Mesa 21.1.5
Diffstat (limited to 'lib/mesa/src/gallium/tests/graw')
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/SConscript | 44 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/fs-fragcoord.c | 3 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/fs-frontface.c | 3 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/fs-test.c | 23 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/fs-write-z.c | 3 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/gs-test.c | 23 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/occlusion-query.c | 3 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/quad-sample.c | 19 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/quad-tex.c | 6 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/shader-leak.c | 13 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/tex-srgb.c | 8 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/tex-swizzle.c | 6 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/tri-gs.c | 13 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/tri-instanced.c | 20 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/tri-large.c | 4 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/tri.c | 4 | ||||
-rw-r--r-- | lib/mesa/src/gallium/tests/graw/vs-test.c | 21 |
17 files changed, 106 insertions, 110 deletions
diff --git a/lib/mesa/src/gallium/tests/graw/SConscript b/lib/mesa/src/gallium/tests/graw/SConscript deleted file mode 100644 index d9d480e85..000000000 --- a/lib/mesa/src/gallium/tests/graw/SConscript +++ /dev/null @@ -1,44 +0,0 @@ -Import('*') - -env = env.Clone() - -env.Prepend(LIBS = [mesautil, gallium]) - -env.Prepend(LIBPATH = [graw.dir]) -env.Prepend(LIBS = ['graw']) - - -if env['platform'] in ('freebsd8', 'sunos'): - env.Append(LIBS = ['m']) - -if env['platform'] == 'freebsd8': - env.Append(LIBS = ['pthread']) - -progs = [ - 'clear', - 'disasm', - 'fs-fragcoord', - 'fs-frontface', - 'fs-test', - 'fs-write-z', - 'gs-test', - 'occlusion-query', - 'quad-sample', - 'quad-tex', - 'shader-leak', - 'tex-srgb', - 'tex-swizzle', - 'tri', - 'tri-large', - 'tri-gs', - 'tri-instanced', - 'vs-test', -] - -for name in progs: - program = env.Program( - target = name, - source = name + '.c', - ) - #env.Depends(program, graw) - env.Alias('graw-progs', program) diff --git a/lib/mesa/src/gallium/tests/graw/fs-fragcoord.c b/lib/mesa/src/gallium/tests/graw/fs-fragcoord.c index 9afea0caa..8be8c6ffe 100644 --- a/lib/mesa/src/gallium/tests/graw/fs-fragcoord.c +++ b/lib/mesa/src/gallium/tests/graw/fs-fragcoord.c @@ -76,7 +76,7 @@ set_vertices(void) sizeof(vertices), vertices); - info.ctx->set_vertex_buffers(info.ctx, 0, 1, &vbuf); + info.ctx->set_vertex_buffers(info.ctx, 0, 1, 0, false, &vbuf); } @@ -185,6 +185,7 @@ draw(void) info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR | PIPE_CLEAR_DEPTHSTENCIL, + NULL, &clear_color, 1.0, 0); util_draw_arrays(info.ctx, PIPE_PRIM_QUADS, 0, NUM_VERTS); info.ctx->flush(info.ctx, NULL, 0); diff --git a/lib/mesa/src/gallium/tests/graw/fs-frontface.c b/lib/mesa/src/gallium/tests/graw/fs-frontface.c index 3ad89f6b6..d74014461 100644 --- a/lib/mesa/src/gallium/tests/graw/fs-frontface.c +++ b/lib/mesa/src/gallium/tests/graw/fs-frontface.c @@ -98,7 +98,7 @@ set_vertices(void) sizeof(vertices), vertices); - info.ctx->set_vertex_buffers(info.ctx, 0, 1, &vbuf); + info.ctx->set_vertex_buffers(info.ctx, 0, 1, 0, false, &vbuf); } @@ -159,6 +159,7 @@ draw(void) info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR | PIPE_CLEAR_DEPTHSTENCIL, + NULL, &clear_color, 1.0, 0); util_draw_arrays(info.ctx, PIPE_PRIM_QUADS, 0, NUM_VERTS); info.ctx->flush(info.ctx, NULL, 0); diff --git a/lib/mesa/src/gallium/tests/graw/fs-test.c b/lib/mesa/src/gallium/tests/graw/fs-test.c index a4182be55..f9bddccda 100644 --- a/lib/mesa/src/gallium/tests/graw/fs-test.c +++ b/lib/mesa/src/gallium/tests/graw/fs-test.c @@ -2,7 +2,7 @@ * any utility code, just the graw interface and gallium. */ -#include "state_tracker/graw.h" +#include "frontend/graw.h" #include "pipe/p_screen.h" #include "pipe/p_context.h" #include "pipe/p_shader_tokens.h" @@ -117,7 +117,7 @@ static void init_fs_constbuf( void ) cb1.user_buffer = constants1; ctx->set_constant_buffer(ctx, - PIPE_SHADER_FRAGMENT, 0, + PIPE_SHADER_FRAGMENT, 0, false, &cb1); memset(&cb2, 0, sizeof cb2); @@ -125,7 +125,7 @@ static void init_fs_constbuf( void ) cb2.user_buffer = constants2; ctx->set_constant_buffer(ctx, - PIPE_SHADER_FRAGMENT, 1, + PIPE_SHADER_FRAGMENT, 1, false, &cb2); } @@ -148,6 +148,11 @@ static void set_viewport( float x, float y, vp.translate[1] = half_height + y; vp.translate[2] = half_depth + z; + vp.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X; + vp.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y; + vp.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z; + vp.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W; + ctx->set_viewport_states( ctx, 0, 1, &vp ); } @@ -179,7 +184,7 @@ static void set_vertices( void ) sizeof(vertices), vertices); - ctx->set_vertex_buffers(ctx, 0, 1, &vbuf); + ctx->set_vertex_buffers(ctx, 0, 1, 0, false, &vbuf); } static void set_vertex_shader( void ) @@ -232,13 +237,13 @@ static void draw( void ) { union pipe_color_union clear_color = { {.1,.3,.5,0} }; - ctx->clear(ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0); + ctx->clear(ctx, PIPE_CLEAR_COLOR, NULL, &clear_color, 0, 0); util_draw_arrays(ctx, PIPE_PRIM_TRIANGLES, 0, 3); ctx->flush(ctx, NULL, 0); graw_save_surface_to_file(ctx, surf, NULL); - screen->flush_frontbuffer(screen, rttex, 0, 0, window, NULL); + screen->flush_frontbuffer(screen, ctx, rttex, 0, 0, window, NULL); } #define SIZE 16 @@ -314,7 +319,7 @@ static void init_tex( void ) ctx->texture_subdata(ctx, samptex, 0, - PIPE_TRANSFER_WRITE, + PIPE_MAP_WRITE, &box, tex2d, sizeof tex2d[0], @@ -328,7 +333,7 @@ static void init_tex( void ) uint32_t *ptr; ptr = pipe_transfer_map(ctx, samptex, 0, 0, /* level, layer */ - PIPE_TRANSFER_READ, + PIPE_MAP_READ, 0, 0, SIZE, SIZE, &t); /* x, y, width, height */ if (memcmp(ptr, tex2d, sizeof tex2d) != 0) { @@ -350,7 +355,7 @@ static void init_tex( void ) if (sv == NULL) exit(5); - ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, &sv); + ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv); memset(&sampler_desc, 0, sizeof sampler_desc); diff --git a/lib/mesa/src/gallium/tests/graw/fs-write-z.c b/lib/mesa/src/gallium/tests/graw/fs-write-z.c index 196c67bc3..ac255b6b6 100644 --- a/lib/mesa/src/gallium/tests/graw/fs-write-z.c +++ b/lib/mesa/src/gallium/tests/graw/fs-write-z.c @@ -102,7 +102,7 @@ set_vertices(void) sizeof(vertices), vertices); - info.ctx->set_vertex_buffers(info.ctx, 0, 1, &vbuf); + info.ctx->set_vertex_buffers(info.ctx, 0, 1, 0, false, &vbuf); } @@ -164,6 +164,7 @@ draw(void) info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR | PIPE_CLEAR_DEPTHSTENCIL, + NULL, &clear_color, 1.0, 0); util_draw_arrays(info.ctx, PIPE_PRIM_QUADS, 0, NUM_VERTS); info.ctx->flush(info.ctx, NULL, 0); diff --git a/lib/mesa/src/gallium/tests/graw/gs-test.c b/lib/mesa/src/gallium/tests/graw/gs-test.c index a984e0acf..4d8f5c31f 100644 --- a/lib/mesa/src/gallium/tests/graw/gs-test.c +++ b/lib/mesa/src/gallium/tests/graw/gs-test.c @@ -2,7 +2,7 @@ * any utility code, just the graw interface and gallium. */ -#include "state_tracker/graw.h" +#include "frontend/graw.h" #include "pipe/p_screen.h" #include "pipe/p_context.h" #include "pipe/p_shader_tokens.h" @@ -169,7 +169,7 @@ static void init_fs_constbuf( void ) { ctx->buffer_subdata(ctx, constbuf1, - PIPE_TRANSFER_WRITE, + PIPE_MAP_WRITE, 0, sizeof(constants1), constants1); pipe_set_constant_buffer(ctx, @@ -178,7 +178,7 @@ static void init_fs_constbuf( void ) } { ctx->buffer_subdata(ctx, constbuf2, - PIPE_TRANSFER_WRITE, + PIPE_MAP_WRITE, 0, sizeof(constants2), constants2); pipe_set_constant_buffer(ctx, @@ -206,6 +206,11 @@ static void set_viewport( float x, float y, vp.translate[1] = half_height + y; vp.translate[2] = half_depth + z; + vp.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X; + vp.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y; + vp.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z; + vp.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W; + ctx->set_viewport_states( ctx, 0, 1, &vp ); } @@ -247,7 +252,7 @@ static void set_vertices( void ) vertices); } - ctx->set_vertex_buffers(ctx, 0, 1, &vbuf); + ctx->set_vertex_buffers(ctx, 0, 1, 0, false, &vbuf); } static void set_vertex_shader( void ) @@ -318,7 +323,7 @@ static void draw( void ) { union pipe_color_union clear_color = { {.1,.3,.5,0} }; - ctx->clear(ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0); + ctx->clear(ctx, PIPE_CLEAR_COLOR, NULL, &clear_color, 0, 0); if (draw_strip) util_draw_arrays(ctx, PIPE_PRIM_TRIANGLE_STRIP, 0, 4); else @@ -328,7 +333,7 @@ static void draw( void ) graw_save_surface_to_file(ctx, surf, NULL); - screen->flush_frontbuffer(screen, rttex, 0, 0, window, NULL); + screen->flush_frontbuffer(screen, ctx, rttex, 0, 0, window, NULL); } #define SIZE 16 @@ -404,7 +409,7 @@ static void init_tex( void ) ctx->texture_subdata(ctx, samptex, 0, - PIPE_TRANSFER_WRITE, + PIPE_MAP_WRITE, &box, tex2d, sizeof tex2d[0], @@ -418,7 +423,7 @@ static void init_tex( void ) uint32_t *ptr; ptr = pipe_transfer_map(ctx, samptex, 0, 0, /* level, layer */ - PIPE_TRANSFER_READ, + PIPE_MAP_READ, 0, 0, SIZE, SIZE, &t); /* x, y, width, height */ if (memcmp(ptr, tex2d, sizeof tex2d) != 0) { @@ -440,7 +445,7 @@ static void init_tex( void ) if (sv == NULL) exit(5); - ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, &sv); + ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv); memset(&sampler_desc, 0, sizeof sampler_desc); diff --git a/lib/mesa/src/gallium/tests/graw/occlusion-query.c b/lib/mesa/src/gallium/tests/graw/occlusion-query.c index 1232c5bb4..9805ef922 100644 --- a/lib/mesa/src/gallium/tests/graw/occlusion-query.c +++ b/lib/mesa/src/gallium/tests/graw/occlusion-query.c @@ -101,7 +101,7 @@ set_vertices(struct vertex *vertices, unsigned bytes) bytes, vertices); - info.ctx->set_vertex_buffers(info.ctx, 0, 1, &vbuf); + info.ctx->set_vertex_buffers(info.ctx, 0, 1, 0, false, &vbuf); } @@ -168,6 +168,7 @@ draw(void) info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR | PIPE_CLEAR_DEPTHSTENCIL, + NULL, &clear_color, 1.0, 0); q1 = info.ctx->create_query(info.ctx, PIPE_QUERY_OCCLUSION_COUNTER, 0); diff --git a/lib/mesa/src/gallium/tests/graw/quad-sample.c b/lib/mesa/src/gallium/tests/graw/quad-sample.c index a5029484b..912df7e7a 100644 --- a/lib/mesa/src/gallium/tests/graw/quad-sample.c +++ b/lib/mesa/src/gallium/tests/graw/quad-sample.c @@ -2,7 +2,7 @@ * any utility code, just the graw interface and gallium. */ -#include "state_tracker/graw.h" +#include "frontend/graw.h" #include "pipe/p_screen.h" #include "pipe/p_context.h" #include "pipe/p_shader_tokens.h" @@ -76,6 +76,11 @@ static void set_viewport( float x, float y, vp.translate[1] = half_height + y; vp.translate[2] = half_depth + z; + vp.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X; + vp.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y; + vp.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z; + vp.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W; + ctx->set_viewport_states( ctx, 0, 1, &vp ); } @@ -105,7 +110,7 @@ static void set_vertices( void ) sizeof(vertices), vertices); - ctx->set_vertex_buffers(ctx, 0, 1, &vbuf); + ctx->set_vertex_buffers(ctx, 0, 1, 0, false, &vbuf); } static void set_vertex_shader( void ) @@ -148,13 +153,13 @@ static void draw( void ) { union pipe_color_union clear_color = { {.5,.5,.5,1} }; - ctx->clear(ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0); + ctx->clear(ctx, PIPE_CLEAR_COLOR, NULL, &clear_color, 0, 0); util_draw_arrays(ctx, PIPE_PRIM_QUADS, 0, 4); ctx->flush(ctx, NULL, 0); graw_save_surface_to_file(ctx, surf, NULL); - screen->flush_frontbuffer(screen, rttex, 0, 0, window, NULL); + screen->flush_frontbuffer(screen, ctx, rttex, 0, 0, window, NULL); } #define SIZE 16 @@ -229,7 +234,7 @@ static void init_tex( void ) ctx->texture_subdata(ctx, samptex, 0, - PIPE_TRANSFER_WRITE, + PIPE_MAP_WRITE, &box, tex2d, sizeof tex2d[0], @@ -243,7 +248,7 @@ static void init_tex( void ) uint32_t *ptr; ptr = pipe_transfer_map(ctx, samptex, 0, 0, /* level, layer */ - PIPE_TRANSFER_READ, + PIPE_MAP_READ, 0, 0, SIZE, SIZE, &t); /* x, y, width, height */ if (memcmp(ptr, tex2d, sizeof tex2d) != 0) { @@ -265,7 +270,7 @@ static void init_tex( void ) if (sv == NULL) exit(5); - ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, &sv); + ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv); memset(&sampler_desc, 0, sizeof sampler_desc); diff --git a/lib/mesa/src/gallium/tests/graw/quad-tex.c b/lib/mesa/src/gallium/tests/graw/quad-tex.c index 35ba4fa34..5eb1ae59e 100644 --- a/lib/mesa/src/gallium/tests/graw/quad-tex.c +++ b/lib/mesa/src/gallium/tests/graw/quad-tex.c @@ -63,7 +63,7 @@ static void set_vertices( void ) sizeof(vertices), vertices); - info.ctx->set_vertex_buffers(info.ctx, 0, 1, &vbuf); + info.ctx->set_vertex_buffers(info.ctx, 0, 1, 0, false, &vbuf); } static void set_vertex_shader( void ) @@ -106,7 +106,7 @@ static void draw( void ) { union pipe_color_union clear_color = { {.5,.5,.5,1} }; - info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0); + info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR, NULL, &clear_color, 0, 0); util_draw_arrays(info.ctx, PIPE_PRIM_QUADS, 0, 4); info.ctx->flush(info.ctx, NULL, 0); @@ -168,7 +168,7 @@ static void init_tex( void ) PIPE_FORMAT_B8G8R8A8_UNORM, tex2d); sv = graw_util_create_simple_sampler_view(&info, texture); - info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, &sv); + info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv); sampler = graw_util_create_simple_sampler(&info, PIPE_TEX_WRAP_REPEAT, diff --git a/lib/mesa/src/gallium/tests/graw/shader-leak.c b/lib/mesa/src/gallium/tests/graw/shader-leak.c index 8fa1a727f..0e121a7d0 100644 --- a/lib/mesa/src/gallium/tests/graw/shader-leak.c +++ b/lib/mesa/src/gallium/tests/graw/shader-leak.c @@ -3,7 +3,7 @@ */ #include <stdio.h> -#include "state_tracker/graw.h" +#include "frontend/graw.h" #include "pipe/p_screen.h" #include "pipe/p_context.h" #include "pipe/p_state.h" @@ -66,6 +66,11 @@ static void set_viewport( float x, float y, vp.translate[1] = half_height + y; vp.translate[2] = half_depth + z; + vp.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X; + vp.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y; + vp.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z; + vp.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W; + ctx->set_viewport_states( ctx, 0, 1, &vp ); } @@ -95,7 +100,7 @@ static void set_vertices( void ) sizeof(vertices), vertices); - ctx->set_vertex_buffers(ctx, 0, 1, &vbuf); + ctx->set_vertex_buffers(ctx, 0, 1, 0, false, &vbuf); } static void set_vertex_shader( void ) @@ -148,7 +153,7 @@ static void draw( void ) ctx->bind_fs_state(ctx, fs); - ctx->clear(ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0); + ctx->clear(ctx, PIPE_CLEAR_COLOR, NULL, &clear_color, 0, 0); util_draw_arrays(ctx, PIPE_PRIM_POINTS, 0, 1); ctx->flush(ctx, NULL, 0); @@ -156,7 +161,7 @@ static void draw( void ) ctx->delete_fs_state(ctx, fs); } - screen->flush_frontbuffer(screen, tex, 0, 0, window, NULL); + screen->flush_frontbuffer(screen, ctx, tex, 0, 0, window, NULL); ctx->destroy(ctx); exit(0); diff --git a/lib/mesa/src/gallium/tests/graw/tex-srgb.c b/lib/mesa/src/gallium/tests/graw/tex-srgb.c index 503350a68..cf9a2a14b 100644 --- a/lib/mesa/src/gallium/tests/graw/tex-srgb.c +++ b/lib/mesa/src/gallium/tests/graw/tex-srgb.c @@ -79,7 +79,7 @@ set_vertices(struct vertex *verts, unsigned num_verts) num_verts * sizeof(struct vertex), verts); - info.ctx->set_vertex_buffers(info.ctx, 0, 1, &vbuf); + info.ctx->set_vertex_buffers(info.ctx, 0, 1, 0, false, &vbuf); } static void set_vertex_shader( void ) @@ -127,13 +127,13 @@ static void draw( void ) clear_color.f[2] = 0.5; clear_color.f[3] = 1.0; - info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0); + info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR, NULL, &clear_color, 0, 0); - info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, &linear_sv); + info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &linear_sv); set_vertices(vertices1, 4); util_draw_arrays(info.ctx, PIPE_PRIM_QUADS, 0, 4); - info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, &srgb_sv); + info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &srgb_sv); set_vertices(vertices2, 4); util_draw_arrays(info.ctx, PIPE_PRIM_QUADS, 0, 4); diff --git a/lib/mesa/src/gallium/tests/graw/tex-swizzle.c b/lib/mesa/src/gallium/tests/graw/tex-swizzle.c index 787f324fc..fa5a3e8e5 100644 --- a/lib/mesa/src/gallium/tests/graw/tex-swizzle.c +++ b/lib/mesa/src/gallium/tests/graw/tex-swizzle.c @@ -61,7 +61,7 @@ static void set_vertices(void) sizeof(vertices), vertices); - info.ctx->set_vertex_buffers(info.ctx, 0, 1, &vbuf); + info.ctx->set_vertex_buffers(info.ctx, 0, 1, 0, false, &vbuf); } static void set_vertex_shader(void) @@ -107,7 +107,7 @@ static void draw(void) clear_color.f[2] = 0.5; clear_color.f[3] = 1.0; - info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0); + info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR, NULL, &clear_color, 0, 0); util_draw_arrays(info.ctx, PIPE_PRIM_QUADS, 0, 4); info.ctx->flush(info.ctx, NULL, 0); @@ -147,7 +147,7 @@ init_tex(const unsigned swizzle[4]) if (sv == NULL) exit(5); - info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, &sv); + info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv); sampler = graw_util_create_simple_sampler(&info, PIPE_TEX_WRAP_REPEAT, diff --git a/lib/mesa/src/gallium/tests/graw/tri-gs.c b/lib/mesa/src/gallium/tests/graw/tri-gs.c index ed721f378..8d5ad2058 100644 --- a/lib/mesa/src/gallium/tests/graw/tri-gs.c +++ b/lib/mesa/src/gallium/tests/graw/tri-gs.c @@ -3,7 +3,7 @@ */ #include <stdio.h> -#include "state_tracker/graw.h" +#include "frontend/graw.h" #include "pipe/p_screen.h" #include "pipe/p_context.h" #include "pipe/p_state.h" @@ -67,6 +67,11 @@ static void set_viewport( float x, float y, vp.translate[1] = half_height + y; vp.translate[2] = half_depth + z; + vp.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X; + vp.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y; + vp.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z; + vp.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W; + ctx->set_viewport_states( ctx, 0, 1, &vp ); } @@ -96,7 +101,7 @@ static void set_vertices( void ) sizeof(vertices), vertices); - ctx->set_vertex_buffers(ctx, 0, 1, &vbuf); + ctx->set_vertex_buffers(ctx, 0, 1, 0, false, &vbuf); } static void set_vertex_shader( void ) @@ -162,11 +167,11 @@ static void draw( void ) { union pipe_color_union clear_color = { {1,0,1,1} }; - ctx->clear(ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0); + ctx->clear(ctx, PIPE_CLEAR_COLOR, NULL, &clear_color, 0, 0); util_draw_arrays(ctx, PIPE_PRIM_TRIANGLES, 0, 3); ctx->flush(ctx, NULL, 0); - screen->flush_frontbuffer(screen, tex, 0, 0, window, NULL); + screen->flush_frontbuffer(screen, ctx, tex, 0, 0, window, NULL); } diff --git a/lib/mesa/src/gallium/tests/graw/tri-instanced.c b/lib/mesa/src/gallium/tests/graw/tri-instanced.c index 297377b89..8ddd26679 100644 --- a/lib/mesa/src/gallium/tests/graw/tri-instanced.c +++ b/lib/mesa/src/gallium/tests/graw/tri-instanced.c @@ -5,7 +5,7 @@ #include <stdio.h> #include <string.h> -#include "state_tracker/graw.h" +#include "frontend/graw.h" #include "pipe/p_screen.h" #include "pipe/p_context.h" #include "pipe/p_state.h" @@ -96,6 +96,11 @@ static void set_viewport( float x, float y, vp.translate[1] = half_height + y; vp.translate[2] = half_depth + z; + vp.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X; + vp.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y; + vp.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z; + vp.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W; + ctx->set_viewport_states( ctx, 0, 1, &vp ); } @@ -147,7 +152,7 @@ static void set_vertices( void ) sizeof(inst_data), inst_data); - ctx->set_vertex_buffers(ctx, 0, 2, vbuf); + ctx->set_vertex_buffers(ctx, 0, 2, 0, false, vbuf); } static void set_vertex_shader( void ) @@ -187,15 +192,16 @@ static void draw( void ) { union pipe_color_union clear_color = { {1,0,1,1} }; struct pipe_draw_info info; + struct pipe_draw_start_count draw; - ctx->clear(ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0); + ctx->clear(ctx, PIPE_CLEAR_COLOR, NULL, &clear_color, 0, 0); util_draw_init_info(&info); info.index_size = draw_elements ? 2 : 0; info.mode = PIPE_PRIM_TRIANGLES; - info.start = 0; - info.count = 3; + draw.start = 0; + draw.count = 3; /* draw NUM_INST triangles */ info.instance_count = NUM_INST; @@ -209,7 +215,7 @@ static void draw( void ) indices); } - ctx->draw_vbo(ctx, &info); + ctx->draw_vbo(ctx, &info, NULL, &draw, 1); pipe_resource_reference(&info.index.resource, NULL); @@ -217,7 +223,7 @@ static void draw( void ) graw_save_surface_to_file(ctx, surf, NULL); - screen->flush_frontbuffer(screen, tex, 0, 0, window, NULL); + screen->flush_frontbuffer(screen, ctx, tex, 0, 0, window, NULL); } diff --git a/lib/mesa/src/gallium/tests/graw/tri-large.c b/lib/mesa/src/gallium/tests/graw/tri-large.c index 78a2ddbda..2f4afb065 100644 --- a/lib/mesa/src/gallium/tests/graw/tri-large.c +++ b/lib/mesa/src/gallium/tests/graw/tri-large.c @@ -65,7 +65,7 @@ static void set_vertices( void ) sizeof(vertices), vertices); - info.ctx->set_vertex_buffers(info.ctx, 0, 1, &vbuf); + info.ctx->set_vertex_buffers(info.ctx, 0, 1, 0, false, &vbuf); } @@ -106,7 +106,7 @@ static void draw( void ) { union pipe_color_union clear_color = { {1,0,1,1} }; - info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0); + info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR, NULL, &clear_color, 0, 0); util_draw_arrays(info.ctx, PIPE_PRIM_TRIANGLES, 0, 3); info.ctx->flush(info.ctx, NULL, 0); diff --git a/lib/mesa/src/gallium/tests/graw/tri.c b/lib/mesa/src/gallium/tests/graw/tri.c index 2267d98a8..4c59a66cb 100644 --- a/lib/mesa/src/gallium/tests/graw/tri.c +++ b/lib/mesa/src/gallium/tests/graw/tri.c @@ -62,7 +62,7 @@ static void set_vertices( void ) sizeof(vertices), vertices); - info.ctx->set_vertex_buffers(info.ctx, 0, 1, &vbuf); + info.ctx->set_vertex_buffers(info.ctx, 0, 1, 0, false, &vbuf); } @@ -103,7 +103,7 @@ static void draw( void ) { union pipe_color_union clear_color = { {1,0,1,1} }; - info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0); + info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR, NULL, &clear_color, 0, 0); util_draw_arrays(info.ctx, PIPE_PRIM_TRIANGLES, 0, 3); info.ctx->flush(info.ctx, NULL, 0); diff --git a/lib/mesa/src/gallium/tests/graw/vs-test.c b/lib/mesa/src/gallium/tests/graw/vs-test.c index b3714543b..23e642b47 100644 --- a/lib/mesa/src/gallium/tests/graw/vs-test.c +++ b/lib/mesa/src/gallium/tests/graw/vs-test.c @@ -2,7 +2,7 @@ * any utility code, just the graw interface and gallium. */ -#include "state_tracker/graw.h" +#include "frontend/graw.h" #include "pipe/p_screen.h" #include "pipe/p_context.h" #include "pipe/p_shader_tokens.h" @@ -101,7 +101,7 @@ static void init_fs_constbuf( void ) u_box_2d(0,0,sizeof(constants),1, &box); ctx->buffer_subdata(ctx, constbuf, - PIPE_TRANSFER_WRITE, + PIPE_MAP_WRITE, 0, sizeof(constants), constants); pipe_set_constant_buffer(ctx, @@ -128,6 +128,11 @@ static void set_viewport( float x, float y, vp.translate[1] = half_height + y; vp.translate[2] = half_depth + z; + vp.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X; + vp.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y; + vp.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z; + vp.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W; + ctx->set_viewport_states( ctx, 0, 1, &vp ); } @@ -172,7 +177,7 @@ static void set_vertices( void ) sizeof(vertices), vertices); - ctx->set_vertex_buffers(ctx, 0, 1, &vbuf); + ctx->set_vertex_buffers(ctx, 0, 1, 0, false, &vbuf); } static void set_vertex_shader( void ) @@ -220,13 +225,13 @@ static void draw( void ) { union pipe_color_union clear_color = { {.1,.3,.5,0} }; - ctx->clear(ctx, PIPE_CLEAR_COLOR, &clear_color, 0, 0); + ctx->clear(ctx, PIPE_CLEAR_COLOR, NULL, &clear_color, 0, 0); util_draw_arrays(ctx, PIPE_PRIM_POINTS, 0, ARRAY_SIZE(vertices)); ctx->flush(ctx, NULL, 0); graw_save_surface_to_file(ctx, surf, NULL); - screen->flush_frontbuffer(screen, rttex, 0, 0, window, NULL); + screen->flush_frontbuffer(screen, ctx, rttex, 0, 0, window, NULL); } #define SIZE 16 @@ -302,7 +307,7 @@ static void init_tex( void ) ctx->texture_subdata(ctx, samptex, 0, - PIPE_TRANSFER_WRITE, + PIPE_MAP_WRITE, &box, tex2d, sizeof tex2d[0], @@ -316,7 +321,7 @@ static void init_tex( void ) uint32_t *ptr; ptr = pipe_transfer_map(ctx, samptex, 0, 0, /* level, layer */ - PIPE_TRANSFER_READ, + PIPE_MAP_READ, 0, 0, SIZE, SIZE, &t); /* x, y, width, height */ if (memcmp(ptr, tex2d, sizeof tex2d) != 0) { @@ -338,7 +343,7 @@ static void init_tex( void ) if (sv == NULL) exit(5); - ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, &sv); + ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv); memset(&sampler_desc, 0, sizeof sampler_desc); |