diff options
author | Marek Olšák <[email protected]> | 2016-08-12 02:33:41 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2016-08-17 14:15:33 +0200 |
commit | 7cd256ce7e4bad680bb77d033cf5dd662abab2dd (patch) | |
tree | 3b4a190876c076129e01792f0e3f4a087a820988 /src/gallium/drivers/nouveau/nv50 | |
parent | 1ac23a9359556091b12ed1345737084e3a2f6ae3 (diff) |
gallium: change pipe_sampler_view::first_element/last_element -> offset/size
This is required by OpenGL. Our hardware supports this.
Example: Bind RGBA32F with offset = 4 bytes.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97305
Acked-by: Ilia Mirkin <[email protected]>
Acked-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nouveau/nv50')
-rw-r--r-- | src/gallium/drivers/nouveau/nv50/nv50_tex.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gallium/drivers/nouveau/nv50/nv50_tex.c b/src/gallium/drivers/nouveau/nv50/nv50_tex.c index 953ab8f4364..ad230186427 100644 --- a/src/gallium/drivers/nouveau/nv50/nv50_tex.c +++ b/src/gallium/drivers/nouveau/nv50/nv50_tex.c @@ -131,11 +131,11 @@ nv50_create_texture_view(struct pipe_context *pipe, if (unlikely(!nouveau_bo_memtype(nv04_resource(texture)->bo))) { if (target == PIPE_BUFFER) { - addr += view->pipe.u.buf.first_element * desc->block.bits / 8; + addr += view->pipe.u.buf.offset; tic[2] |= G80_TIC_2_LAYOUT_PITCH | G80_TIC_2_TEXTURE_TYPE_ONE_D_BUFFER; tic[3] = 0; tic[4] = /* width */ - view->pipe.u.buf.last_element - view->pipe.u.buf.first_element + 1; + view->pipe.u.buf.size / (desc->block.bits / 8); tic[5] = 0; } else { tic[2] |= G80_TIC_2_LAYOUT_PITCH | G80_TIC_2_TEXTURE_TYPE_TWO_D_NO_MIPMAP; @@ -224,8 +224,7 @@ nv50_update_tic(struct nv50_context *nv50, struct nv50_tic_entry *tic, uint64_t address = res->address; if (res->base.target != PIPE_BUFFER) return; - address += tic->pipe.u.buf.first_element * - util_format_get_blocksize(tic->pipe.format); + address += tic->pipe.u.buf.offset; if (tic->tic[1] == (uint32_t)address && (tic->tic[2] & 0xff) == address >> 32) return; |