summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/hud/hud_context.c9
-rw-r--r--src/gallium/auxiliary/postprocess/pp_run.c3
-rw-r--r--src/gallium/auxiliary/tgsi/tgsi_ureg.c4
-rw-r--r--src/gallium/auxiliary/util/u_simple_shaders.c18
-rw-r--r--src/gallium/auxiliary/util/u_tests.c3
5 files changed, 20 insertions, 17 deletions
diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c
index 146c7ccd5e3..7870da5464a 100644
--- a/src/gallium/auxiliary/hud/hud_context.c
+++ b/src/gallium/auxiliary/hud/hud_context.c
@@ -1202,7 +1202,7 @@ hud_create(struct pipe_context *pipe, struct cso_context *cso)
};
struct tgsi_token tokens[1000];
- struct pipe_shader_state state = {tokens};
+ struct pipe_shader_state state;
if (!tgsi_text_translate(fragment_shader_text, tokens, ARRAY_SIZE(tokens))) {
assert(0);
@@ -1211,7 +1211,7 @@ hud_create(struct pipe_context *pipe, struct cso_context *cso)
FREE(hud);
return NULL;
}
-
+ pipe_shader_state_from_tgsi(&state, tokens);
hud->fs_text = pipe->create_fs_state(pipe, &state);
}
@@ -1249,8 +1249,7 @@ hud_create(struct pipe_context *pipe, struct cso_context *cso)
};
struct tgsi_token tokens[1000];
- struct pipe_shader_state state = {tokens};
-
+ struct pipe_shader_state state;
if (!tgsi_text_translate(vertex_shader_text, tokens, ARRAY_SIZE(tokens))) {
assert(0);
pipe_resource_reference(&hud->font.texture, NULL);
@@ -1258,7 +1257,7 @@ hud_create(struct pipe_context *pipe, struct cso_context *cso)
FREE(hud);
return NULL;
}
-
+ pipe_shader_state_from_tgsi(&state, tokens);
hud->vs = pipe->create_vs_state(pipe, &state);
}
diff --git a/src/gallium/auxiliary/postprocess/pp_run.c b/src/gallium/auxiliary/postprocess/pp_run.c
index bc79c5aab6e..41fa7ed69e6 100644
--- a/src/gallium/auxiliary/postprocess/pp_run.c
+++ b/src/gallium/auxiliary/postprocess/pp_run.c
@@ -255,8 +255,7 @@ pp_tgsi_to_state(struct pipe_context *pipe, const char *text, bool isvs,
return NULL;
}
- state.tokens = tokens;
- memset(&state.stream_output, 0, sizeof(state.stream_output));
+ pipe_shader_state_from_tgsi(&state, tokens);
if (isvs) {
ret_state = pipe->create_vs_state(pipe, &state);
diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
index 43b8bb10f1c..b67c383eb38 100644
--- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c
+++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c
@@ -2019,14 +2019,12 @@ void *ureg_create_shader( struct ureg_program *ureg,
{
struct pipe_shader_state state;
- state.tokens = ureg_finalize(ureg);
+ pipe_shader_state_from_tgsi(&state, ureg_finalize(ureg));
if(!state.tokens)
return NULL;
if (so)
state.stream_output = *so;
- else
- memset(&state.stream_output, 0, sizeof(state.stream_output));
switch (ureg->processor) {
case PIPE_SHADER_VERTEX:
diff --git a/src/gallium/auxiliary/util/u_simple_shaders.c b/src/gallium/auxiliary/util/u_simple_shaders.c
index 5b5c8512470..1220e187eac 100644
--- a/src/gallium/auxiliary/util/u_simple_shaders.c
+++ b/src/gallium/auxiliary/util/u_simple_shaders.c
@@ -121,12 +121,13 @@ void *util_make_layered_clear_vertex_shader(struct pipe_context *pipe)
"MOV OUT[2], SV[0]\n"
"END\n";
struct tgsi_token tokens[1000];
- struct pipe_shader_state state = {tokens};
+ struct pipe_shader_state state;
if (!tgsi_text_translate(text, tokens, ARRAY_SIZE(tokens))) {
assert(0);
return NULL;
}
+ pipe_shader_state_from_tgsi(&state, tokens);
return pipe->create_vs_state(pipe, &state);
}
@@ -149,12 +150,13 @@ void *util_make_layered_clear_helper_vertex_shader(struct pipe_context *pipe)
"MOV OUT[2].x, SV[0].xxxx\n"
"END\n";
struct tgsi_token tokens[1000];
- struct pipe_shader_state state = {tokens};
+ struct pipe_shader_state state;
if (!tgsi_text_translate(text, tokens, ARRAY_SIZE(tokens))) {
assert(0);
return NULL;
}
+ pipe_shader_state_from_tgsi(&state, tokens);
return pipe->create_vs_state(pipe, &state);
}
@@ -192,12 +194,13 @@ void *util_make_layered_clear_geometry_shader(struct pipe_context *pipe)
"EMIT IMM[0].xxxx\n"
"END\n";
struct tgsi_token tokens[1000];
- struct pipe_shader_state state = {tokens};
+ struct pipe_shader_state state;
if (!tgsi_text_translate(text, tokens, ARRAY_SIZE(tokens))) {
assert(0);
return NULL;
}
+ pipe_shader_state_from_tgsi(&state, tokens);
return pipe->create_gs_state(pipe, &state);
}
@@ -471,7 +474,7 @@ util_make_fragment_passthrough_shader(struct pipe_context *pipe,
char text[sizeof(shader_templ)+100];
struct tgsi_token tokens[1000];
- struct pipe_shader_state state = {tokens};
+ struct pipe_shader_state state;
sprintf(text, shader_templ,
write_all_cbufs ? "PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1\n" : "",
@@ -482,6 +485,7 @@ util_make_fragment_passthrough_shader(struct pipe_context *pipe,
assert(0);
return NULL;
}
+ pipe_shader_state_from_tgsi(&state, tokens);
#if 0
tgsi_dump(state.tokens, 0);
#endif
@@ -558,7 +562,7 @@ util_make_fs_blit_msaa_gen(struct pipe_context *pipe,
const char *type = tgsi_texture_names[tgsi_tex];
char text[sizeof(shader_templ)+100];
struct tgsi_token tokens[1000];
- struct pipe_shader_state state = {tokens};
+ struct pipe_shader_state state;
assert(tgsi_tex == TGSI_TEXTURE_2D_MSAA ||
tgsi_tex == TGSI_TEXTURE_2D_ARRAY_MSAA);
@@ -571,6 +575,7 @@ util_make_fs_blit_msaa_gen(struct pipe_context *pipe,
assert(0);
return NULL;
}
+ pipe_shader_state_from_tgsi(&state, tokens);
#if 0
tgsi_dump(state.tokens, 0);
#endif
@@ -659,7 +664,7 @@ util_make_fs_blit_msaa_depthstencil(struct pipe_context *pipe,
const char *type = tgsi_texture_names[tgsi_tex];
char text[sizeof(shader_templ)+100];
struct tgsi_token tokens[1000];
- struct pipe_shader_state state = {tokens};
+ struct pipe_shader_state state;
assert(tgsi_tex == TGSI_TEXTURE_2D_MSAA ||
tgsi_tex == TGSI_TEXTURE_2D_ARRAY_MSAA);
@@ -670,6 +675,7 @@ util_make_fs_blit_msaa_depthstencil(struct pipe_context *pipe,
assert(0);
return NULL;
}
+ pipe_shader_state_from_tgsi(&state, tokens);
#if 0
tgsi_dump(state.tokens, 0);
#endif
diff --git a/src/gallium/auxiliary/util/u_tests.c b/src/gallium/auxiliary/util/u_tests.c
index 52102900cda..f22ffceb6bc 100644
--- a/src/gallium/auxiliary/util/u_tests.c
+++ b/src/gallium/auxiliary/util/u_tests.c
@@ -422,13 +422,14 @@ null_constant_buffer(struct pipe_context *ctx)
"MOV OUT[0], CONST[0]\n"
"END\n";
struct tgsi_token tokens[1000];
- struct pipe_shader_state state = {tokens};
+ struct pipe_shader_state state;
if (!tgsi_text_translate(text, tokens, ARRAY_SIZE(tokens))) {
puts("Can't compile a fragment shader.");
util_report_result(FAIL);
return;
}
+ pipe_shader_state_from_tgsi(&state, tokens);
fs = ctx->create_fs_state(ctx, &state);
cso_set_fragment_shader_handle(cso, fs);
}