summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_atom_rasterizer.c14
-rw-r--r--src/mesa/state_tracker/st_cache.c13
2 files changed, 24 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c
index 435d604af7..229839d8b2 100644
--- a/src/mesa/state_tracker/st_atom_rasterizer.c
+++ b/src/mesa/state_tracker/st_atom_rasterizer.c
@@ -30,7 +30,7 @@
* Keith Whitwell <keith@tungstengraphics.com>
*/
-
+#include "main/macros.h"
#include "st_context.h"
#include "st_cache.h"
#include "pipe/p_context.h"
@@ -227,8 +227,18 @@ static void update_raster_state( struct st_context *st )
/* _NEW_LINE
*/
- raster.line_width = ctx->Line.Width;
raster.line_smooth = ctx->Line.SmoothFlag;
+ if (ctx->Line.SmoothFlag) {
+ raster.line_width = CLAMP(ctx->Line.Width,
+ ctx->Const.MinLineWidthAA,
+ ctx->Const.MaxLineWidthAA);
+ }
+ else {
+ raster.line_width = CLAMP(ctx->Line.Width,
+ ctx->Const.MinLineWidth,
+ ctx->Const.MaxLineWidth);
+ }
+
raster.line_stipple_enable = ctx->Line.StippleFlag;
raster.line_stipple_pattern = ctx->Line.StipplePattern;
/* GL stipple factor is in [1,256], remap to [0, 255] here */
diff --git a/src/mesa/state_tracker/st_cache.c b/src/mesa/state_tracker/st_cache.c
index 2979e7fae5..7ee4fadc37 100644
--- a/src/mesa/state_tracker/st_cache.c
+++ b/src/mesa/state_tracker/st_cache.c
@@ -63,6 +63,8 @@ const struct cso_blend * st_cached_blend_state(struct st_context *st,
cso->data = st->pipe->create_blend_state(st->pipe, &cso->state);
if (!cso->data)
cso->data = &cso->state;
+ cso->delete_state = (cso_state_callback)st->pipe->delete_blend_state;
+ cso->context = st->pipe;
iter = cso_insert_state(st->cache, hash_key, CSO_BLEND, cso);
}
return ((struct cso_blend *)cso_hash_iter_data(iter));
@@ -82,6 +84,8 @@ st_cached_sampler_state(struct st_context *st,
cso->data = st->pipe->create_sampler_state(st->pipe, &cso->state);
if (!cso->data)
cso->data = &cso->state;
+ cso->delete_state = (cso_state_callback)st->pipe->delete_sampler_state;
+ cso->context = st->pipe;
iter = cso_insert_state(st->cache, hash_key, CSO_SAMPLER, cso);
}
return (struct cso_sampler*)(cso_hash_iter_data(iter));
@@ -103,6 +107,8 @@ st_cached_depth_stencil_alpha_state(struct st_context *st,
cso->data = st->pipe->create_depth_stencil_alpha_state(st->pipe, &cso->state);
if (!cso->data)
cso->data = &cso->state;
+ cso->delete_state = (cso_state_callback)st->pipe->delete_depth_stencil_alpha_state;
+ cso->context = st->pipe;
iter = cso_insert_state(st->cache, hash_key, CSO_DEPTH_STENCIL_ALPHA, cso);
}
return (struct cso_depth_stencil_alpha*)(cso_hash_iter_data(iter));
@@ -123,6 +129,8 @@ const struct cso_rasterizer* st_cached_rasterizer_state(
cso->data = st->pipe->create_rasterizer_state(st->pipe, &cso->state);
if (!cso->data)
cso->data = &cso->state;
+ cso->delete_state = (cso_state_callback)st->pipe->delete_rasterizer_state;
+ cso->context = st->pipe;
iter = cso_insert_state(st->cache, hash_key, CSO_RASTERIZER, cso);
}
return (struct cso_rasterizer*)(cso_hash_iter_data(iter));
@@ -143,6 +151,8 @@ st_cached_fs_state(struct st_context *st,
cso->data = st->pipe->create_fs_state(st->pipe, &cso->state);
if (!cso->data)
cso->data = &cso->state;
+ cso->delete_state = (cso_state_callback)st->pipe->delete_fs_state;
+ cso->context = st->pipe;
iter = cso_insert_state(st->cache, hash_key, CSO_FRAGMENT_SHADER, cso);
}
return (struct cso_fragment_shader*)(cso_hash_iter_data(iter));
@@ -163,8 +173,9 @@ st_cached_vs_state(struct st_context *st,
cso->data = st->pipe->create_vs_state(st->pipe, &cso->state);
if (!cso->data)
cso->data = &cso->state;
+ cso->delete_state = (cso_state_callback)st->pipe->delete_vs_state;
+ cso->context = st->pipe;
iter = cso_insert_state(st->cache, hash_key, CSO_VERTEX_SHADER, cso);
}
return (struct cso_vertex_shader*)(cso_hash_iter_data(iter));
}
-