summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/tests
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2021-07-22 10:50:50 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2021-07-22 10:50:50 +0000
commit9130ec005fbc78a62420643414d8354d0929ca50 (patch)
tree6762777acdd2d4eee17ef87290e80dc7afe2b73d /lib/mesa/src/gallium/tests
parentca11beabae33eb59fb981b8adf50b1d47a2a98f0 (diff)
Merge Mesa 21.1.5
Diffstat (limited to 'lib/mesa/src/gallium/tests')
-rw-r--r--lib/mesa/src/gallium/tests/graw/SConscript44
-rw-r--r--lib/mesa/src/gallium/tests/graw/fs-fragcoord.c3
-rw-r--r--lib/mesa/src/gallium/tests/graw/fs-frontface.c3
-rw-r--r--lib/mesa/src/gallium/tests/graw/fs-test.c23
-rw-r--r--lib/mesa/src/gallium/tests/graw/fs-write-z.c3
-rw-r--r--lib/mesa/src/gallium/tests/graw/gs-test.c23
-rw-r--r--lib/mesa/src/gallium/tests/graw/occlusion-query.c3
-rw-r--r--lib/mesa/src/gallium/tests/graw/quad-sample.c19
-rw-r--r--lib/mesa/src/gallium/tests/graw/quad-tex.c6
-rw-r--r--lib/mesa/src/gallium/tests/graw/shader-leak.c13
-rw-r--r--lib/mesa/src/gallium/tests/graw/tex-srgb.c8
-rw-r--r--lib/mesa/src/gallium/tests/graw/tex-swizzle.c6
-rw-r--r--lib/mesa/src/gallium/tests/graw/tri-gs.c13
-rw-r--r--lib/mesa/src/gallium/tests/graw/tri-instanced.c20
-rw-r--r--lib/mesa/src/gallium/tests/graw/tri-large.c4
-rw-r--r--lib/mesa/src/gallium/tests/graw/tri.c4
-rw-r--r--lib/mesa/src/gallium/tests/graw/vs-test.c21
-rw-r--r--lib/mesa/src/gallium/tests/trivial/compute.c26
-rw-r--r--lib/mesa/src/gallium/tests/trivial/quad-tex.c38
-rw-r--r--lib/mesa/src/gallium/tests/trivial/tri.c33
-rw-r--r--lib/mesa/src/gallium/tests/unit/SConscript29
-rw-r--r--lib/mesa/src/gallium/tests/unit/u_cache_test.c1
22 files changed, 163 insertions, 180 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);
diff --git a/lib/mesa/src/gallium/tests/trivial/compute.c b/lib/mesa/src/gallium/tests/trivial/compute.c
index 2047a5241..a1ca7f3c3 100644
--- a/lib/mesa/src/gallium/tests/trivial/compute.c
+++ b/lib/mesa/src/gallium/tests/trivial/compute.c
@@ -71,7 +71,7 @@ struct context {
static void init_ctx(struct context *ctx)
{
- int ret;
+ ASSERTED int ret;
ret = pipe_loader_probe(&ctx->dev, 1);
assert(ret);
@@ -153,7 +153,7 @@ static void init_prog(struct context *ctx, unsigned local_sz,
.req_input_mem = input_sz
};
char *psrc = preprocess_prog(ctx, src, defs);
- int ret;
+ ASSERTED int ret;
ret = tgsi_text_translate(psrc, prog, ARRAY_SIZE(prog));
assert(ret);
@@ -204,7 +204,7 @@ static void init_tex(struct context *ctx, int slot,
*tex = ctx->screen->resource_create(ctx->screen, &ttex);
assert(*tex);
- map = pipe->transfer_map(pipe, *tex, 0, PIPE_TRANSFER_WRITE,
+ map = pipe->transfer_map(pipe, *tex, 0, PIPE_MAP_WRITE,
&(struct pipe_box) { .width = w,
.height = h,
.depth = 1 }, &xfer);
@@ -246,7 +246,7 @@ static void check_tex(struct context *ctx, int slot,
if (!check)
check = default_check;
- map = pipe->transfer_map(pipe, tex, 0, PIPE_TRANSFER_READ,
+ map = pipe->transfer_map(pipe, tex, 0, PIPE_MAP_READ,
&(struct pipe_box) { .width = tex->width0,
.height = tex->height0,
.depth = 1 }, &xfer);
@@ -315,7 +315,7 @@ static void init_sampler_views(struct context *ctx, const int *slots)
assert(ctx->view[i]);
}
- pipe->set_sampler_views(pipe, PIPE_SHADER_COMPUTE, 0, i, ctx->view);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_COMPUTE, 0, i, 0, ctx->view);
}
static void destroy_sampler_views(struct context *ctx)
@@ -323,7 +323,7 @@ static void destroy_sampler_views(struct context *ctx)
struct pipe_context *pipe = ctx->pipe;
int i;
- pipe->set_sampler_views(pipe, PIPE_SHADER_COMPUTE, 0, MAX_RESOURCES, NULL);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_COMPUTE, 0, 0, MAX_RESOURCES, NULL);
for (i = 0; i < MAX_RESOURCES; ++i) {
if (ctx->view[i]) {
@@ -1072,7 +1072,7 @@ static void test_surface_ld_init0f(void *p, int s, int x, int y)
float v[] = { 1.0, -.75, .50, -.25 };
int i = 0;
- util_format_write_4f(surface_fmts[i], v, 0, p, 0, 0, 0, 1, 1);
+ util_format_pack_rgba(surface_fmts[i], p, v, 1);
}
static void test_surface_ld_init0i(void *p, int s, int x, int y)
@@ -1080,7 +1080,7 @@ static void test_surface_ld_init0i(void *p, int s, int x, int y)
int v[] = { 0xffffffff, 0xffff, 0xff, 0xf };
int i = 0;
- util_format_write_4i(surface_fmts[i], v, 0, p, 0, 0, 0, 1, 1);
+ util_format_pack_rgba(surface_fmts[i], p, v, 1);
}
static void test_surface_ld_expectf(void *p, int s, int x, int y)
@@ -1089,7 +1089,7 @@ static void test_surface_ld_expectf(void *p, int s, int x, int y)
int i = 0;
test_surface_ld_init0f(v, s, x / 4, y);
- util_format_read_4f(surface_fmts[i], w, 0, v, 0, 0, 0, 1, 1);
+ util_format_unpack_rgba(surface_fmts[i], w, v, 1);
*(float *)p = w[x % 4];
}
@@ -1099,7 +1099,7 @@ static void test_surface_ld_expecti(void *p, int s, int x, int y)
int i = 0;
test_surface_ld_init0i(v, s, x / 4, y);
- util_format_read_4i(surface_fmts[i], w, 0, v, 0, 0, 0, 1, 1);
+ util_format_unpack_rgba(surface_fmts[i], w, v, 1);
*(uint32_t *)p = w[x % 4];
}
@@ -1180,7 +1180,7 @@ static void test_surface_st_expectf(void *p, int s, int x, int y)
for (j = 0; j < 4; j++)
test_surface_st_init0f(&vf[j], s, 4 * x + j, y);
- util_format_write_4f(surface_fmts[i], vf, 0, p, 0, 0, 0, 1, 1);
+ util_format_pack_rgba(surface_fmts[i], p, vf, 1);
}
static void test_surface_st_expects(void *p, int s, int x, int y)
@@ -1190,7 +1190,7 @@ static void test_surface_st_expects(void *p, int s, int x, int y)
for (j = 0; j < 4; j++)
test_surface_st_init0i(&v[j], s, 4 * x + j, y);
- util_format_write_4i(surface_fmts[i], v, 0, p, 0, 0, 0, 1, 1);
+ util_format_pack_rgba(surface_fmts[i], p, v, 1);
}
static void test_surface_st_expectu(void *p, int s, int x, int y)
@@ -1200,7 +1200,7 @@ static void test_surface_st_expectu(void *p, int s, int x, int y)
for (j = 0; j < 4; j++)
test_surface_st_init0i(&v[j], s, 4 * x + j, y);
- util_format_write_4ui(surface_fmts[i], v, 0, p, 0, 0, 0, 1, 1);
+ util_format_pack_rgba(surface_fmts[i], p, v, 1);
}
static bool test_surface_st_check(void *x, void *y, int sz)
diff --git a/lib/mesa/src/gallium/tests/trivial/quad-tex.c b/lib/mesa/src/gallium/tests/trivial/quad-tex.c
index 9a9d70122..79e9c39ca 100644
--- a/lib/mesa/src/gallium/tests/trivial/quad-tex.c
+++ b/lib/mesa/src/gallium/tests/trivial/quad-tex.c
@@ -47,6 +47,7 @@
/* constant state object helper */
#include "cso_cache/cso_context.h"
+#include "util/macros.h"
/* u_sampler_view_default_template */
#include "util/u_sampler.h"
/* debug_dump_surface_bmp */
@@ -73,7 +74,7 @@ struct program
struct pipe_sampler_state sampler;
struct pipe_viewport_state viewport;
struct pipe_framebuffer_state framebuffer;
- struct pipe_vertex_element velem[2];
+ struct cso_velems_state velem;
void *vs;
void *fs;
@@ -89,7 +90,7 @@ struct program
static void init_prog(struct program *p)
{
struct pipe_surface surf_tmpl;
- int ret;
+ ASSERTED int ret;
/* find a hardware device */
ret = pipe_loader_probe(&p->dev, 1);
@@ -176,7 +177,7 @@ static void init_prog(struct program *p)
box.height = 2;
box.depth = 1;
- ptr = p->pipe->transfer_map(p->pipe, p->tex, 0, PIPE_TRANSFER_WRITE, &box, &t);
+ ptr = p->pipe->transfer_map(p->pipe, p->tex, 0, PIPE_MAP_WRITE, &box, &t);
ptr[0] = 0xffff0000;
ptr[1] = 0xff0000ff;
ptr[2] = 0xff00ff00;
@@ -249,19 +250,26 @@ static void init_prog(struct program *p)
p->viewport.translate[0] = half_width + x;
p->viewport.translate[1] = (half_height + y) * scale + bias;
p->viewport.translate[2] = half_depth + z;
+
+ p->viewport.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
+ p->viewport.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
+ p->viewport.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z;
+ p->viewport.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
}
/* vertex elements state */
- memset(p->velem, 0, sizeof(p->velem));
- p->velem[0].src_offset = 0 * 4 * sizeof(float); /* offset 0, first element */
- p->velem[0].instance_divisor = 0;
- p->velem[0].vertex_buffer_index = 0;
- p->velem[0].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
+ memset(&p->velem, 0, sizeof(p->velem));
+ p->velem.count = 2;
+
+ p->velem.velems[0].src_offset = 0 * 4 * sizeof(float); /* offset 0, first element */
+ p->velem.velems[0].instance_divisor = 0;
+ p->velem.velems[0].vertex_buffer_index = 0;
+ p->velem.velems[0].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
- p->velem[1].src_offset = 1 * 4 * sizeof(float); /* offset 16, second element */
- p->velem[1].instance_divisor = 0;
- p->velem[1].vertex_buffer_index = 0;
- p->velem[1].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
+ p->velem.velems[1].src_offset = 1 * 4 * sizeof(float); /* offset 16, second element */
+ p->velem.velems[1].instance_divisor = 0;
+ p->velem.velems[1].vertex_buffer_index = 0;
+ p->velem.velems[1].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
/* vertex shader */
{
@@ -307,7 +315,7 @@ static void draw(struct program *p)
cso_set_framebuffer(p->cso, &p->framebuffer);
/* clear the render target */
- p->pipe->clear(p->pipe, PIPE_CLEAR_COLOR, &p->clear_color, 0, 0);
+ p->pipe->clear(p->pipe, PIPE_CLEAR_COLOR, NULL, &p->clear_color, 0, 0);
/* set misc state we care about */
cso_set_blend(p->cso, &p->blend);
@@ -319,14 +327,14 @@ static void draw(struct program *p)
cso_set_samplers(p->cso, PIPE_SHADER_FRAGMENT, 1, samplers);
/* texture sampler view */
- cso_set_sampler_views(p->cso, PIPE_SHADER_FRAGMENT, 1, &p->view);
+ p->pipe->set_sampler_views(p->pipe, PIPE_SHADER_FRAGMENT, 0, 1, 0, &p->view);
/* shaders */
cso_set_fragment_shader_handle(p->cso, p->fs);
cso_set_vertex_shader_handle(p->cso, p->vs);
/* vertex element data */
- cso_set_vertex_elements(p->cso, 2, p->velem);
+ cso_set_vertex_elements(p->cso, &p->velem);
util_draw_vertex_buffer(p->pipe, p->cso,
p->vbuf, 0, 0,
diff --git a/lib/mesa/src/gallium/tests/trivial/tri.c b/lib/mesa/src/gallium/tests/trivial/tri.c
index 3827edc0d..0bc09a983 100644
--- a/lib/mesa/src/gallium/tests/trivial/tri.c
+++ b/lib/mesa/src/gallium/tests/trivial/tri.c
@@ -70,7 +70,7 @@ struct program
struct pipe_rasterizer_state rasterizer;
struct pipe_viewport_state viewport;
struct pipe_framebuffer_state framebuffer;
- struct pipe_vertex_element velem[2];
+ struct cso_velems_state velem;
void *vs;
void *fs;
@@ -84,7 +84,7 @@ struct program
static void init_prog(struct program *p)
{
struct pipe_surface surf_tmpl;
- int ret;
+ ASSERTED int ret;
/* find a hardware device */
ret = pipe_loader_probe(&p->dev, 1);
@@ -193,19 +193,26 @@ static void init_prog(struct program *p)
p->viewport.translate[0] = half_width + x;
p->viewport.translate[1] = (half_height + y) * scale + bias;
p->viewport.translate[2] = half_depth + z;
+
+ p->viewport.swizzle_x = PIPE_VIEWPORT_SWIZZLE_POSITIVE_X;
+ p->viewport.swizzle_y = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Y;
+ p->viewport.swizzle_z = PIPE_VIEWPORT_SWIZZLE_POSITIVE_Z;
+ p->viewport.swizzle_w = PIPE_VIEWPORT_SWIZZLE_POSITIVE_W;
}
/* vertex elements state */
- memset(p->velem, 0, sizeof(p->velem));
- p->velem[0].src_offset = 0 * 4 * sizeof(float); /* offset 0, first element */
- p->velem[0].instance_divisor = 0;
- p->velem[0].vertex_buffer_index = 0;
- p->velem[0].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
+ memset(&p->velem, 0, sizeof(p->velem));
+ p->velem.count = 2;
+
+ p->velem.velems[0].src_offset = 0 * 4 * sizeof(float); /* offset 0, first element */
+ p->velem.velems[0].instance_divisor = 0;
+ p->velem.velems[0].vertex_buffer_index = 0;
+ p->velem.velems[0].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
- p->velem[1].src_offset = 1 * 4 * sizeof(float); /* offset 16, second element */
- p->velem[1].instance_divisor = 0;
- p->velem[1].vertex_buffer_index = 0;
- p->velem[1].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
+ p->velem.velems[1].src_offset = 1 * 4 * sizeof(float); /* offset 16, second element */
+ p->velem.velems[1].instance_divisor = 0;
+ p->velem.velems[1].vertex_buffer_index = 0;
+ p->velem.velems[1].src_format = PIPE_FORMAT_R32G32B32A32_FLOAT;
/* vertex shader */
{
@@ -244,7 +251,7 @@ static void draw(struct program *p)
cso_set_framebuffer(p->cso, &p->framebuffer);
/* clear the render target */
- p->pipe->clear(p->pipe, PIPE_CLEAR_COLOR, &p->clear_color, 0, 0);
+ p->pipe->clear(p->pipe, PIPE_CLEAR_COLOR, NULL, &p->clear_color, 0, 0);
/* set misc state we care about */
cso_set_blend(p->cso, &p->blend);
@@ -257,7 +264,7 @@ static void draw(struct program *p)
cso_set_vertex_shader_handle(p->cso, p->vs);
/* vertex element data */
- cso_set_vertex_elements(p->cso, 2, p->velem);
+ cso_set_vertex_elements(p->cso, &p->velem);
util_draw_vertex_buffer(p->pipe, p->cso,
p->vbuf, 0, 0,
diff --git a/lib/mesa/src/gallium/tests/unit/SConscript b/lib/mesa/src/gallium/tests/unit/SConscript
deleted file mode 100644
index 446539633..000000000
--- a/lib/mesa/src/gallium/tests/unit/SConscript
+++ /dev/null
@@ -1,29 +0,0 @@
-Import('*')
-
-env = env.Clone()
-
-env.Prepend(LIBS = [mesautil, gallium])
-
-if env['platform'] in ('freebsd8', 'sunos'):
- env.Append(LIBS = ['m'])
-
-if env['platform'] == 'freebsd8':
- env.Append(LIBS = ['pthread'])
-
-progs = [
- 'pipe_barrier_test',
- 'u_cache_test',
- 'u_half_test',
- 'translate_test'
-]
-
-for progname in progs:
- prog = env.Program(
- target = progname,
- source = progname + '.c',
- )
- if progname not in [
- 'u_cache_test', # too long
- 'translate_test', # unreliable
- ]:
- env.UnitTest(progname, prog)
diff --git a/lib/mesa/src/gallium/tests/unit/u_cache_test.c b/lib/mesa/src/gallium/tests/unit/u_cache_test.c
index cf8f70ba5..16fb1b865 100644
--- a/lib/mesa/src/gallium/tests/unit/u_cache_test.c
+++ b/lib/mesa/src/gallium/tests/unit/u_cache_test.c
@@ -89,6 +89,7 @@ int main() {
*key = 0xdeadbeef;
value_out = (cache_test_value *) util_cache_get(cache, key);
assert(value_out == NULL);
+ (void)value_out;
free(key);