X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;ds=inline;f=src%2Fmesa%2Fswrast%2Fs_texfetch.c;h=67b3cf7c457456f24b1741e2dbb520cd91128983;hb=87942749a327725014b0d160b3e48d6d83723ac2;hp=5e1a9f7832415779848432130ccc2f80e9ba96f9;hpb=f9fa725690c470daf308fcf155dec061ac6e059d;p=mesa.git diff --git a/src/mesa/swrast/s_texfetch.c b/src/mesa/swrast/s_texfetch.c index 5e1a9f78324..67b3cf7c457 100644 --- a/src/mesa/swrast/s_texfetch.c +++ b/src/mesa/swrast/s_texfetch.c @@ -1,6 +1,5 @@ /* * Mesa 3-D graphics library - * Version: 7.7 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * Copyright (c) 2009 VMware, Inc. @@ -18,9 +17,10 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ @@ -97,10 +97,17 @@ static void fetch_compressed(const struct swrast_texture_image *swImage, GLint i, GLint j, GLint k, GLfloat *texel) { - swImage->FetchCompressedTexel(swImage->Map, - swImage->ImageOffsets, - swImage->RowStride, - i, j, k, texel); + /* The FetchCompressedTexel function takes an integer pixel rowstride, + * while the image's rowstride is bytes per row of blocks. + */ + GLuint bw, bh; + GLuint texelBytes = _mesa_get_format_bytes(swImage->Base.TexFormat); + _mesa_get_format_block_size(swImage->Base.TexFormat, &bw, &bh); + assert(swImage->RowStride * bw % texelBytes == 0); + + swImage->FetchCompressedTexel(swImage->ImageSlices[k], + swImage->RowStride * bw / texelBytes, + i, j, texel); } @@ -1233,9 +1240,9 @@ texfetch_funcs[] = }, { MESA_FORMAT_XBGR16161616_UNORM, - NULL, - NULL, - NULL + fetch_texel_1d_xbgr16161616_unorm, + fetch_texel_2d_xbgr16161616_unorm, + fetch_texel_3d_xbgr16161616_unorm }, { MESA_FORMAT_XBGR16161616_SNORM, @@ -1245,9 +1252,9 @@ texfetch_funcs[] = }, { MESA_FORMAT_XBGR16161616_FLOAT, - NULL, - NULL, - NULL + fetch_texel_1d_xbgr16161616_float, + fetch_texel_2d_xbgr16161616_float, + fetch_texel_3d_xbgr16161616_float }, { MESA_FORMAT_XBGR16161616_UINT, @@ -1263,18 +1270,24 @@ texfetch_funcs[] = }, { MESA_FORMAT_XBGR32323232_FLOAT, + fetch_texel_1d_xbgr32323232_float, + fetch_texel_2d_xbgr32323232_float, + fetch_texel_3d_xbgr32323232_float + }, + { + MESA_FORMAT_XBGR32323232_UINT, NULL, NULL, NULL }, { - MESA_FORMAT_XBGR32323232_UINT, + MESA_FORMAT_XBGR32323232_SINT, NULL, NULL, NULL }, { - MESA_FORMAT_XBGR32323232_SINT, + MESA_FORMAT_ABGR2101010, NULL, NULL, NULL