diff options
author | Dave Airlie <[email protected]> | 2013-03-04 06:17:11 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2013-04-11 21:09:29 +0100 |
commit | f152da6bf990c330108da25972f28e08b2f233aa (patch) | |
tree | 2f4facdaca58bacf07360f82d45bcd0aa8fe47ec /src/mesa/state_tracker/st_texture.c | |
parent | 1d90ee5ef500e604267439557f99d94b49d7fbb6 (diff) |
st/mesa: add support for ARB_texture_multisample (v3)
This adds support to the mesa state tracker for ARB_texture_multisample.
hardware doesn't seem to use a different texture instructions, so
I don't think we need to create one for TGSI at this time.
Thanks to Marek for fixes to sample number picking.
v2: idr pointed out a bug in how we picked the max sample counts,
use new internal format chooser interface to pick proper answers.
v3: use st_choose_format directly, it was okay, fix anding of masks.
Reviewed-by: Marek Olšák <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_texture.c')
-rw-r--r-- | src/mesa/state_tracker/st_texture.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index ed37098483e..9a271826eaa 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -60,6 +60,7 @@ st_texture_create(struct st_context *st, GLuint height0, GLuint depth0, GLuint layers, + GLuint nr_samples, GLuint bind ) { struct pipe_resource pt, *newtex; @@ -90,6 +91,7 @@ st_texture_create(struct st_context *st, pt.usage = PIPE_USAGE_DEFAULT; pt.bind = bind; pt.flags = 0; + pt.nr_samples = nr_samples; newtex = screen->resource_create(screen, &pt); @@ -138,6 +140,8 @@ st_gl_texture_dims_to_pipe_dims(GLenum texture, case GL_TEXTURE_RECTANGLE: case GL_PROXY_TEXTURE_RECTANGLE: case GL_TEXTURE_EXTERNAL_OES: + case GL_PROXY_TEXTURE_2D_MULTISAMPLE: + case GL_TEXTURE_2D_MULTISAMPLE: assert(depthIn == 1); *widthOut = widthIn; *heightOut = heightIn; @@ -159,7 +163,9 @@ st_gl_texture_dims_to_pipe_dims(GLenum texture, *layersOut = 6; break; case GL_TEXTURE_2D_ARRAY: + case GL_TEXTURE_2D_MULTISAMPLE_ARRAY: case GL_PROXY_TEXTURE_2D_ARRAY: + case GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY: *widthOut = widthIn; *heightOut = heightIn; *depthOut = 1; @@ -402,7 +408,7 @@ st_create_color_map_texture(struct gl_context *ctx) /* create texture for color map/table */ pt = st_texture_create(st, PIPE_TEXTURE_2D, format, 0, - texSize, texSize, 1, 1, PIPE_BIND_SAMPLER_VIEW); + texSize, texSize, 1, 1, 0, PIPE_BIND_SAMPLER_VIEW); return pt; } |