Merge remote branch 'origin/7.8'
[mesa.git] / src / gallium / state_trackers / vega / shader.c
index f2ec24c57ff219b59d1f108443818954bee2459c..6eef94ce7670e5384820cf28a5480d0f7eb7dba3 100644 (file)
@@ -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;
 };
@@ -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);