gallium: identify depth-stencil textures
And don't use the display-target path to allocate them.
This commit is contained in:
@@ -286,7 +286,8 @@ struct pipe_surface
|
|||||||
|
|
||||||
#define PIPE_TEXTURE_USAGE_RENDER_TARGET 0x1
|
#define PIPE_TEXTURE_USAGE_RENDER_TARGET 0x1
|
||||||
#define PIPE_TEXTURE_USAGE_DISPLAY_TARGET 0x2 /* ie a backbuffer */
|
#define PIPE_TEXTURE_USAGE_DISPLAY_TARGET 0x2 /* ie a backbuffer */
|
||||||
#define PIPE_TEXTURE_USAGE_SAMPLER 0x4
|
#define PIPE_TEXTURE_USAGE_DEPTH_STENCIL 0x4
|
||||||
|
#define PIPE_TEXTURE_USAGE_SAMPLER 0x8
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Texture object.
|
* Texture object.
|
||||||
|
@@ -77,6 +77,11 @@ init_renderbuffer_bits(struct st_renderbuffer *strb,
|
|||||||
return info.size;
|
return info.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static INLINE GLboolean pf_is_depth_stencil( enum pipe_format format )
|
||||||
|
{
|
||||||
|
return (pf_get_component_bits( format, PIPE_FORMAT_COMP_Z ) +
|
||||||
|
pf_get_component_bits( format, PIPE_FORMAT_COMP_S )) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gl_renderbuffer::AllocStorage()
|
* gl_renderbuffer::AllocStorage()
|
||||||
@@ -117,8 +122,15 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
|
|||||||
template.height[0] = height;
|
template.height[0] = height;
|
||||||
template.depth[0] = 1;
|
template.depth[0] = 1;
|
||||||
template.last_level = 0;
|
template.last_level = 0;
|
||||||
template.tex_usage = (PIPE_TEXTURE_USAGE_DISPLAY_TARGET |
|
|
||||||
PIPE_TEXTURE_USAGE_RENDER_TARGET);
|
if (pf_is_depth_stencil(template.format)) {
|
||||||
|
template.tex_usage = PIPE_TEXTURE_USAGE_DEPTH_STENCIL;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
template.tex_usage = (PIPE_TEXTURE_USAGE_DISPLAY_TARGET |
|
||||||
|
PIPE_TEXTURE_USAGE_RENDER_TARGET);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Probably need dedicated flags for surface usage too:
|
/* Probably need dedicated flags for surface usage too:
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user