summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/r300/r300_context.c')
-rw-r--r--src/gallium/drivers/r300/r300_context.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c
index 624dadd07d..e8c09b214a 100644
--- a/src/gallium/drivers/r300/r300_context.c
+++ b/src/gallium/drivers/r300/r300_context.c
@@ -79,6 +79,9 @@ static void r300_release_referenced_objects(struct r300_context *r300)
NULL);
}
+ /* The dummy VBO. */
+ pipe_resource_reference(&r300->dummy_vb, NULL);
+
/* The SWTCL VBO. */
pipe_resource_reference(&r300->vbo, NULL);
@@ -184,7 +187,7 @@ static void r300_setup_atoms(struct r300_context* r300)
boolean has_tcl = r300->screen->caps.has_tcl;
boolean drm_2_3_0 = r300->rws->get_value(r300->rws, R300_VID_DRM_2_3_0);
boolean drm_2_6_0 = r300->rws->get_value(r300->rws, R300_VID_DRM_2_6_0);
- boolean has_hyperz = r300->rws->get_value(r300->rws, R300_CAN_HYPERZ);
+ boolean can_hyperz = r300->rws->get_value(r300->rws, R300_CAN_HYPERZ);
boolean has_hiz_ram = r300->screen->caps.hiz_ram > 0;
/* Create the actual atom list.
@@ -240,7 +243,7 @@ static void r300_setup_atoms(struct r300_context* r300)
/* TX. */
R300_INIT_ATOM(texture_cache_inval, 2);
R300_INIT_ATOM(textures_state, 0);
- if (has_hyperz) {
+ if (can_hyperz) {
/* HiZ Clear */
if (has_hiz_ram)
R300_INIT_ATOM(hiz_clear, 0);
@@ -488,6 +491,7 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
rtempl.target = PIPE_TEXTURE_2D;
rtempl.format = PIPE_FORMAT_I8_UNORM;
rtempl.bind = PIPE_BIND_SAMPLER_VIEW;
+ rtempl.usage = PIPE_USAGE_IMMUTABLE;
rtempl.width0 = 1;
rtempl.height0 = 1;
rtempl.depth0 = 1;
@@ -501,6 +505,19 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen,
pipe_resource_reference(&tex, NULL);
}
+ {
+ struct pipe_resource vb = {};
+ vb.target = PIPE_BUFFER;
+ vb.format = PIPE_FORMAT_R8_UNORM;
+ vb.bind = PIPE_BIND_VERTEX_BUFFER;
+ vb.usage = PIPE_USAGE_IMMUTABLE;
+ vb.width0 = sizeof(float) * 16;
+ vb.height0 = 1;
+ vb.depth0 = 1;
+
+ r300->dummy_vb = screen->resource_create(screen, &vb);
+ }
+
return &r300->context;
fail: