aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-11-25 17:01:42 -0500
committerMarek Olšák <[email protected]>2019-11-26 15:14:10 -0500
commit6cf011fcc8131c32ccccba2cf8dcb6cc12699e5e (patch)
tree09dd12180f5e4d9ea05b19ffb1057f383cdba254 /src/mesa
parent3fdf2bb313b7e91f223fc45ad68adea9d5e76407 (diff)
st/mesa: don't serialize all streamout state if there are no SO outputs
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_shader_cache.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_shader_cache.c b/src/mesa/state_tracker/st_shader_cache.c
index b777e8dcbba..6543a532630 100644
--- a/src/mesa/state_tracker/st_shader_cache.c
+++ b/src/mesa/state_tracker/st_shader_cache.c
@@ -44,8 +44,13 @@ static void
write_stream_out_to_cache(struct blob *blob,
struct pipe_shader_state *state)
{
- blob_write_bytes(blob, &state->stream_output,
- sizeof(state->stream_output));
+ blob_write_uint32(blob, state->stream_output.num_outputs);
+ if (state->stream_output.num_outputs) {
+ blob_write_bytes(blob, &state->stream_output.stride,
+ sizeof(state->stream_output.stride));
+ blob_write_bytes(blob, &state->stream_output.output,
+ sizeof(state->stream_output.output));
+ }
}
static void
@@ -139,8 +144,14 @@ static void
read_stream_out_from_cache(struct blob_reader *blob_reader,
struct pipe_shader_state *state)
{
- blob_copy_bytes(blob_reader, (uint8_t *) &state->stream_output,
- sizeof(state->stream_output));
+ memset(&state->stream_output, 0, sizeof(state->stream_output));
+ state->stream_output.num_outputs = blob_read_uint32(blob_reader);
+ if (state->stream_output.num_outputs) {
+ blob_copy_bytes(blob_reader, &state->stream_output.stride,
+ sizeof(state->stream_output.stride));
+ blob_copy_bytes(blob_reader, &state->stream_output.output,
+ sizeof(state->stream_output.output));
+ }
}
static void