X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fgallium%2Fstate_trackers%2Fvega%2Fshader.c;h=eab1349639c2881f41c651864ffd5b81c2b0736e;hb=c492066071c17e55740f3eed69b3344e6f1793ff;hp=f2ec24c57ff219b59d1f108443818954bee2459c;hpb=75b8c4a8f869f63991c774caa7e1cec7e988c5ec;p=mesa.git diff --git a/src/gallium/state_trackers/vega/shader.c b/src/gallium/state_trackers/vega/shader.c index f2ec24c57ff..eab1349639c 100644 --- a/src/gallium/state_trackers/vega/shader.c +++ b/src/gallium/state_trackers/vega/shader.c @@ -51,7 +51,7 @@ struct shader { VGImageMode image_mode; float constants[MAX_CONSTANTS]; - struct pipe_buffer *cbuf; + struct pipe_resource *cbuf; struct pipe_shader_state fs_state; void *fs; }; @@ -68,7 +68,7 @@ struct shader * shader_create(struct vg_context *ctx) void shader_destroy(struct shader *shader) { - free(shader); + FREE(shader); } void shader_set_masking(struct shader *shader, VGboolean set) @@ -96,7 +96,7 @@ static void setup_constant_buffer(struct shader *shader) { struct vg_context *ctx = shader->context; struct pipe_context *pipe = shader->context->pipe; - struct pipe_buffer **cbuf = &shader->cbuf; + struct pipe_resource **cbuf = &shader->cbuf; VGint param_bytes = paint_constant_buffer_size(shader->paint); float temp_buf[MAX_CONSTANTS]; @@ -106,12 +106,13 @@ static void setup_constant_buffer(struct shader *shader) if (*cbuf == NULL || memcmp(temp_buf, shader->constants, param_bytes) != 0) { - pipe_buffer_reference(cbuf, NULL); + pipe_resource_reference(cbuf, NULL); memcpy(shader->constants, temp_buf, param_bytes); *cbuf = pipe_user_buffer_create(pipe->screen, &shader->constants, - sizeof(shader->constants)); + sizeof(shader->constants), + PIPE_BIND_VERTEX_BUFFER); } ctx->pipe->set_constant_buffer(ctx->pipe, PIPE_SHADER_FRAGMENT, 0, *cbuf);