projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
st/nine: Begin programmable shader fog support
[mesa.git]
/
src
/
gallium
/
tests
/
trivial
/
quad-tex.c
diff --git
a/src/gallium/tests/trivial/quad-tex.c
b/src/gallium/tests/trivial/quad-tex.c
index 1d52aff34396235d98c41dec22a59a6ac3d1450c..c019c7bb0a3c590b9579db22b2d0965c4686b3fd 100644
(file)
--- a/
src/gallium/tests/trivial/quad-tex.c
+++ b/
src/gallium/tests/trivial/quad-tex.c
@@
-243,12
+243,10
@@
static void init_prog(struct program *p)
p->viewport.scale[0] = half_width;
p->viewport.scale[1] = half_height * scale;
p->viewport.scale[2] = half_depth;
p->viewport.scale[0] = half_width;
p->viewport.scale[1] = half_height * scale;
p->viewport.scale[2] = half_depth;
- p->viewport.scale[3] = 1.0f;
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.translate[0] = half_width + x;
p->viewport.translate[1] = (half_height + y) * scale + bias;
p->viewport.translate[2] = half_depth + z;
- p->viewport.translate[3] = 0.0f;
}
/* vertex elements state */
}
/* vertex elements state */
@@
-268,20
+266,18
@@
static void init_prog(struct program *p)
const uint semantic_names[] = { TGSI_SEMANTIC_POSITION,
TGSI_SEMANTIC_GENERIC };
const uint semantic_indexes[] = { 0, 0 };
const uint semantic_names[] = { TGSI_SEMANTIC_POSITION,
TGSI_SEMANTIC_GENERIC };
const uint semantic_indexes[] = { 0, 0 };
- p->vs = util_make_vertex_passthrough_shader(p->pipe, 2, semantic_names, semantic_indexes);
+ p->vs = util_make_vertex_passthrough_shader(p->pipe, 2, semantic_names, semantic_indexes
, FALSE
);
}
/* fragment shader */
}
/* fragment shader */
- p->fs = util_make_fragment_tex_shader(p->pipe, TGSI_TEXTURE_2D, TGSI_INTERPOLATE_LINEAR);
+ p->fs = util_make_fragment_tex_shader(p->pipe, TGSI_TEXTURE_2D,
+ TGSI_INTERPOLATE_LINEAR,
+ TGSI_RETURN_TYPE_FLOAT);
}
static void close_prog(struct program *p)
{
}
static void close_prog(struct program *p)
{
- /* unset bound textures as well */
- cso_set_sampler_views(p->cso, PIPE_SHADER_FRAGMENT, 0, NULL);
-
- /* unset all state */
- cso_release_all(p->cso);
+ cso_destroy_context(p->cso);
p->pipe->delete_vs_state(p->pipe, p->vs);
p->pipe->delete_fs_state(p->pipe, p->fs);
p->pipe->delete_vs_state(p->pipe, p->vs);
p->pipe->delete_fs_state(p->pipe, p->fs);
@@
-292,7
+288,6
@@
static void close_prog(struct program *p)
pipe_resource_reference(&p->tex, NULL);
pipe_resource_reference(&p->vbuf, NULL);
pipe_resource_reference(&p->tex, NULL);
pipe_resource_reference(&p->vbuf, NULL);
- cso_destroy_context(p->cso);
p->pipe->destroy(p->pipe);
p->screen->destroy(p->screen);
pipe_loader_release(&p->dev, 1);
p->pipe->destroy(p->pipe);
p->screen->destroy(p->screen);
pipe_loader_release(&p->dev, 1);
@@
-302,6
+297,8
@@
static void close_prog(struct program *p)
static void draw(struct program *p)
{
static void draw(struct program *p)
{
+ const struct pipe_sampler_state *samplers[] = {&p->sampler};
+
/* set the render target */
cso_set_framebuffer(p->cso, &p->framebuffer);
/* set the render target */
cso_set_framebuffer(p->cso, &p->framebuffer);
@@
-315,8
+312,7
@@
static void draw(struct program *p)
cso_set_viewport(p->cso, &p->viewport);
/* sampler */
cso_set_viewport(p->cso, &p->viewport);
/* sampler */
- cso_single_sampler(p->cso, PIPE_SHADER_FRAGMENT, 0, &p->sampler);
- cso_single_sampler_done(p->cso, PIPE_SHADER_FRAGMENT);
+ 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);
/* texture sampler view */
cso_set_sampler_views(p->cso, PIPE_SHADER_FRAGMENT, 1, &p->view);