svga: rename "tex_usage" to "bindings", add comments

Trivial.
This commit is contained in:
Brian Paul 2014-01-23 15:04:40 -07:00
parent e2dd240e32
commit a44554870e
1 changed files with 11 additions and 7 deletions

View File

@ -402,25 +402,29 @@ static int svga_get_shader_param(struct pipe_screen *screen, unsigned shader, en
} }
/**
* Implemnt pipe_screen::is_format_supported().
* \param bindings bitmask of PIPE_BIND_x flags
*/
static boolean static boolean
svga_is_format_supported( struct pipe_screen *screen, svga_is_format_supported( struct pipe_screen *screen,
enum pipe_format format, enum pipe_format format,
enum pipe_texture_target target, enum pipe_texture_target target,
unsigned sample_count, unsigned sample_count,
unsigned tex_usage) unsigned bindings)
{ {
struct svga_screen *ss = svga_screen(screen); struct svga_screen *ss = svga_screen(screen);
SVGA3dSurfaceFormat svga_format; SVGA3dSurfaceFormat svga_format;
SVGA3dSurfaceFormatCaps caps; SVGA3dSurfaceFormatCaps caps;
SVGA3dSurfaceFormatCaps mask; SVGA3dSurfaceFormatCaps mask;
assert(tex_usage); assert(bindings);
if (sample_count > 1) { if (sample_count > 1) {
return FALSE; return FALSE;
} }
svga_format = svga_translate_format(ss, format, tex_usage); svga_format = svga_translate_format(ss, format, bindings);
if (svga_format == SVGA3D_FORMAT_INVALID) { if (svga_format == SVGA3D_FORMAT_INVALID) {
return FALSE; return FALSE;
} }
@ -430,7 +434,7 @@ svga_is_format_supported( struct pipe_screen *screen,
* visuals for all virtual hardware implementations. * visuals for all virtual hardware implementations.
*/ */
if (tex_usage & PIPE_BIND_DISPLAY_TARGET) { if (bindings & PIPE_BIND_DISPLAY_TARGET) {
switch (svga_format) { switch (svga_format) {
case SVGA3D_A8R8G8B8: case SVGA3D_A8R8G8B8:
case SVGA3D_X8R8G8B8: case SVGA3D_X8R8G8B8:
@ -456,13 +460,13 @@ svga_is_format_supported( struct pipe_screen *screen,
svga_get_format_cap(ss, svga_format, &caps); svga_get_format_cap(ss, svga_format, &caps);
mask.value = 0; mask.value = 0;
if (tex_usage & PIPE_BIND_RENDER_TARGET) { if (bindings & PIPE_BIND_RENDER_TARGET) {
mask.offscreenRenderTarget = 1; mask.offscreenRenderTarget = 1;
} }
if (tex_usage & PIPE_BIND_DEPTH_STENCIL) { if (bindings & PIPE_BIND_DEPTH_STENCIL) {
mask.zStencil = 1; mask.zStencil = 1;
} }
if (tex_usage & PIPE_BIND_SAMPLER_VIEW) { if (bindings & PIPE_BIND_SAMPLER_VIEW) {
mask.texture = 1; mask.texture = 1;
} }