diff options
author | Viktor Novotný <[email protected]> | 2012-05-01 15:23:50 +0200 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2012-05-02 03:13:42 +0200 |
commit | 6d5efe96ee710ca1dd5f745f74a5bbfa4fd42fd9 (patch) | |
tree | 2aaf60d6df163f777e7c8abeabff527d0c0274cb /src/mesa/drivers/dri/nouveau/nouveau_surface.c | |
parent | b389b608d8d853c1f9383b04a222d96a5a096178 (diff) |
dri/nouveau: Add general support for compressed formats.
Signed-off-by: Viktor Novotný <[email protected]>
Signed-off-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nouveau_surface.c')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nouveau_surface.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nouveau_surface.c b/src/mesa/drivers/dri/nouveau/nouveau_surface.c index f2521149088..ffac309b9ef 100644 --- a/src/mesa/drivers/dri/nouveau/nouveau_surface.c +++ b/src/mesa/drivers/dri/nouveau/nouveau_surface.c @@ -28,6 +28,8 @@ #include "nouveau_context.h" #include "nouveau_util.h" +#include "main/formats.h" + void nouveau_surface_alloc(struct gl_context *ctx, struct nouveau_surface *s, enum nouveau_surface_layout layout, @@ -45,7 +47,7 @@ nouveau_surface_alloc(struct gl_context *ctx, struct nouveau_surface *s, .width = width, .height = height, .cpp = cpp, - .pitch = width * cpp, + .pitch = _mesa_format_row_stride(format, width), }; if (layout == TILED) { @@ -64,7 +66,8 @@ nouveau_surface_alloc(struct gl_context *ctx, struct nouveau_surface *s, s->pitch = align(s->pitch, 64); } - ret = nouveau_bo_new(context_dev(ctx), flags, 0, s->pitch * height, + ret = nouveau_bo_new(context_dev(ctx), flags, 0, + get_format_blocksy(format, height) * s->pitch, &config, &s->bo); assert(!ret); } |