summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/cso_cache/cso_context.c
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-05-27 00:59:41 +1000
committerBen Skeggs <skeggsb@gmail.com>2008-05-27 00:59:41 +1000
commit0f9635d9d522ea712724415599ceb44d53e67819 (patch)
tree91484d00053baeb265d04a54a116229562194217 /src/gallium/auxiliary/cso_cache/cso_context.c
parent8f67f98959261d193cb5f3db274b55fb24e2bb1e (diff)
parent253066d716e3039522eeb7b072811cccd89b4a82 (diff)
Merge remote branch 'upstream/gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'src/gallium/auxiliary/cso_cache/cso_context.c')
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_context.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_context.c b/src/gallium/auxiliary/cso_cache/cso_context.c
index a1a3a9efaf..af4af8ac1d 100644
--- a/src/gallium/auxiliary/cso_cache/cso_context.c
+++ b/src/gallium/auxiliary/cso_cache/cso_context.c
@@ -292,7 +292,7 @@ enum pipe_error cso_set_blend(struct cso_context *ctx,
if (!cso)
return PIPE_ERROR_OUT_OF_MEMORY;
- cso->state = *templ;
+ memcpy(&cso->state, templ, sizeof(*templ));
cso->data = ctx->pipe->create_blend_state(ctx->pipe, &cso->state);
cso->delete_state = (cso_state_callback)ctx->pipe->delete_blend_state;
cso->context = ctx->pipe;
@@ -350,7 +350,7 @@ enum pipe_error cso_single_sampler(struct cso_context *ctx,
if (!cso)
return PIPE_ERROR_OUT_OF_MEMORY;
- cso->state = *templ;
+ memcpy(&cso->state, templ, sizeof(*templ));
cso->data = ctx->pipe->create_sampler_state(ctx->pipe, &cso->state);
cso->delete_state = (cso_state_callback)ctx->pipe->delete_sampler_state;
cso->context = ctx->pipe;
@@ -508,7 +508,7 @@ enum pipe_error cso_set_depth_stencil_alpha(struct cso_context *ctx,
if (!cso)
return PIPE_ERROR_OUT_OF_MEMORY;
- cso->state = *templ;
+ memcpy(&cso->state, templ, sizeof(*templ));
cso->data = ctx->pipe->create_depth_stencil_alpha_state(ctx->pipe, &cso->state);
cso->delete_state = (cso_state_callback)ctx->pipe->delete_depth_stencil_alpha_state;
cso->context = ctx->pipe;
@@ -564,7 +564,7 @@ enum pipe_error cso_set_rasterizer(struct cso_context *ctx,
if (!cso)
return PIPE_ERROR_OUT_OF_MEMORY;
- cso->state = *templ;
+ memcpy(&cso->state, templ, sizeof(*templ));
cso->data = ctx->pipe->create_rasterizer_state(ctx->pipe, &cso->state);
cso->delete_state = (cso_state_callback)ctx->pipe->delete_rasterizer_state;
cso->context = ctx->pipe;
@@ -726,7 +726,7 @@ enum pipe_error cso_set_vertex_shader(struct cso_context *ctx,
if (!cso)
return PIPE_ERROR_OUT_OF_MEMORY;
- cso->state = *templ;
+ memcpy(cso->state, templ, sizeof(*templ));
cso->data = ctx->pipe->create_vs_state(ctx->pipe, &cso->state);
cso->delete_state = (cso_state_callback)ctx->pipe->delete_vs_state;
cso->context = ctx->pipe;
@@ -769,8 +769,7 @@ void cso_restore_vertex_shader(struct cso_context *ctx)
enum pipe_error cso_set_framebuffer(struct cso_context *ctx,
const struct pipe_framebuffer_state *fb)
{
- /* XXX this memcmp() fails to detect buffer size changes */
- if (1/*memcmp(&ctx->fb, fb, sizeof(*fb))*/) {
+ if (memcmp(&ctx->fb, fb, sizeof(*fb)) != 0) {
ctx->fb = *fb;
ctx->pipe->set_framebuffer_state(ctx->pipe, fb);
}