vc4: Add support for all the texture and FBO formats we can.

Now that tiling is in place, we can expose the other formats.  Depth is
still broken (need to make changes in the shader), but if you don't expose
it things crash all over.  SNORM is dropped, but we could re-add it later
with some shader fixes to handle converting between [0,1] and [-1,1].
This commit is contained in:
Eric Anholt
2014-08-19 23:14:51 -07:00
parent 3a1efcc7f9
commit b064c9103d
7 changed files with 203 additions and 72 deletions

View File

@@ -267,11 +267,14 @@ static enum vc4_texture_data_type
get_resource_texture_format(struct pipe_resource *prsc)
{
struct vc4_resource *rsc = vc4_resource(prsc);
uint8_t format = vc4_get_tex_format(prsc->format);
if (rsc->tiled)
return VC4_TEXTURE_TYPE_RGBA8888;
else
if (!rsc->tiled) {
assert(format == VC4_TEXTURE_TYPE_RGBA8888);
return VC4_TEXTURE_TYPE_RGBA32R;
}
return format;
}
static struct pipe_resource *