aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texcompress_s3tc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/texcompress_s3tc.c')
-rw-r--r--mesalib/src/mesa/main/texcompress_s3tc.c64
1 files changed, 28 insertions, 36 deletions
diff --git a/mesalib/src/mesa/main/texcompress_s3tc.c b/mesalib/src/mesa/main/texcompress_s3tc.c
index 4a81ad803..41ea33613 100644
--- a/mesalib/src/mesa/main/texcompress_s3tc.c
+++ b/mesalib/src/mesa/main/texcompress_s3tc.c
@@ -18,9 +18,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.
*/
@@ -39,7 +40,6 @@
#include "dlopen.h"
#include "image.h"
#include "macros.h"
-#include "mfeatures.h"
#include "mtypes.h"
#include "texcompress.h"
#include "texcompress_s3tc.h"
@@ -345,13 +345,12 @@ problem(const char *func)
static void
-fetch_rgb_dxt1(const GLubyte *map, const GLuint imageOffsets[],
- GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel)
+fetch_rgb_dxt1(const GLubyte *map,
+ GLint rowStride, GLint i, GLint j, GLfloat *texel)
{
if (fetch_ext_rgb_dxt1) {
- GLuint sliceOffset = k ? imageOffsets[k] / 2 : 0;
GLubyte tex[4];
- fetch_ext_rgb_dxt1(rowStride, map + sliceOffset, i, j, tex);
+ fetch_ext_rgb_dxt1(rowStride, map, i, j, tex);
texel[RCOMP] = UBYTE_TO_FLOAT(tex[RCOMP]);
texel[GCOMP] = UBYTE_TO_FLOAT(tex[GCOMP]);
texel[BCOMP] = UBYTE_TO_FLOAT(tex[BCOMP]);
@@ -363,13 +362,12 @@ fetch_rgb_dxt1(const GLubyte *map, const GLuint imageOffsets[],
}
static void
-fetch_rgba_dxt1(const GLubyte *map, const GLuint imageOffsets[],
- GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel)
+fetch_rgba_dxt1(const GLubyte *map,
+ GLint rowStride, GLint i, GLint j, GLfloat *texel)
{
if (fetch_ext_rgba_dxt1) {
- GLuint sliceOffset = k ? imageOffsets[k] / 2 : 0;
GLubyte tex[4];
- fetch_ext_rgba_dxt1(rowStride, map + sliceOffset, i, j, tex);
+ fetch_ext_rgba_dxt1(rowStride, map, i, j, tex);
texel[RCOMP] = UBYTE_TO_FLOAT(tex[RCOMP]);
texel[GCOMP] = UBYTE_TO_FLOAT(tex[GCOMP]);
texel[BCOMP] = UBYTE_TO_FLOAT(tex[BCOMP]);
@@ -381,13 +379,12 @@ fetch_rgba_dxt1(const GLubyte *map, const GLuint imageOffsets[],
}
static void
-fetch_rgba_dxt3(const GLubyte *map, const GLuint imageOffsets[],
- GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel)
+fetch_rgba_dxt3(const GLubyte *map,
+ GLint rowStride, GLint i, GLint j, GLfloat *texel)
{
if (fetch_ext_rgba_dxt3) {
- GLuint sliceOffset = k ? imageOffsets[k] : 0;
GLubyte tex[4];
- fetch_ext_rgba_dxt3(rowStride, map + sliceOffset, i, j, tex);
+ fetch_ext_rgba_dxt3(rowStride, map, i, j, tex);
texel[RCOMP] = UBYTE_TO_FLOAT(tex[RCOMP]);
texel[GCOMP] = UBYTE_TO_FLOAT(tex[GCOMP]);
texel[BCOMP] = UBYTE_TO_FLOAT(tex[BCOMP]);
@@ -399,13 +396,12 @@ fetch_rgba_dxt3(const GLubyte *map, const GLuint imageOffsets[],
}
static void
-fetch_rgba_dxt5(const GLubyte *map, const GLuint imageOffsets[],
- GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel)
+fetch_rgba_dxt5(const GLubyte *map,
+ GLint rowStride, GLint i, GLint j, GLfloat *texel)
{
if (fetch_ext_rgba_dxt5) {
- GLuint sliceOffset = k ? imageOffsets[k] : 0;
GLubyte tex[4];
- fetch_ext_rgba_dxt5(rowStride, map + sliceOffset, i, j, tex);
+ fetch_ext_rgba_dxt5(rowStride, map, i, j, tex);
texel[RCOMP] = UBYTE_TO_FLOAT(tex[RCOMP]);
texel[GCOMP] = UBYTE_TO_FLOAT(tex[GCOMP]);
texel[BCOMP] = UBYTE_TO_FLOAT(tex[BCOMP]);
@@ -418,13 +414,12 @@ fetch_rgba_dxt5(const GLubyte *map, const GLuint imageOffsets[],
static void
-fetch_srgb_dxt1(const GLubyte *map, const GLuint imageOffsets[],
- GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel)
+fetch_srgb_dxt1(const GLubyte *map,
+ GLint rowStride, GLint i, GLint j, GLfloat *texel)
{
if (fetch_ext_rgb_dxt1) {
- GLuint sliceOffset = k ? imageOffsets[k] / 2 : 0;
GLubyte tex[4];
- fetch_ext_rgb_dxt1(rowStride, map + sliceOffset, i, j, tex);
+ fetch_ext_rgb_dxt1(rowStride, map, i, j, tex);
texel[RCOMP] = _mesa_nonlinear_to_linear(tex[RCOMP]);
texel[GCOMP] = _mesa_nonlinear_to_linear(tex[GCOMP]);
texel[BCOMP] = _mesa_nonlinear_to_linear(tex[BCOMP]);
@@ -436,13 +431,12 @@ fetch_srgb_dxt1(const GLubyte *map, const GLuint imageOffsets[],
}
static void
-fetch_srgba_dxt1(const GLubyte *map, const GLuint imageOffsets[],
- GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel)
+fetch_srgba_dxt1(const GLubyte *map,
+ GLint rowStride, GLint i, GLint j, GLfloat *texel)
{
if (fetch_ext_rgba_dxt1) {
- GLuint sliceOffset = k ? imageOffsets[k] / 2 : 0;
GLubyte tex[4];
- fetch_ext_rgba_dxt1(rowStride, map + sliceOffset, i, j, tex);
+ fetch_ext_rgba_dxt1(rowStride, map, i, j, tex);
texel[RCOMP] = _mesa_nonlinear_to_linear(tex[RCOMP]);
texel[GCOMP] = _mesa_nonlinear_to_linear(tex[GCOMP]);
texel[BCOMP] = _mesa_nonlinear_to_linear(tex[BCOMP]);
@@ -454,13 +448,12 @@ fetch_srgba_dxt1(const GLubyte *map, const GLuint imageOffsets[],
}
static void
-fetch_srgba_dxt3(const GLubyte *map, const GLuint imageOffsets[],
- GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel)
+fetch_srgba_dxt3(const GLubyte *map,
+ GLint rowStride, GLint i, GLint j, GLfloat *texel)
{
if (fetch_ext_rgba_dxt3) {
- GLuint sliceOffset = k ? imageOffsets[k] : 0;
GLubyte tex[4];
- fetch_ext_rgba_dxt3(rowStride, map + sliceOffset, i, j, tex);
+ fetch_ext_rgba_dxt3(rowStride, map, i, j, tex);
texel[RCOMP] = _mesa_nonlinear_to_linear(tex[RCOMP]);
texel[GCOMP] = _mesa_nonlinear_to_linear(tex[GCOMP]);
texel[BCOMP] = _mesa_nonlinear_to_linear(tex[BCOMP]);
@@ -472,13 +465,12 @@ fetch_srgba_dxt3(const GLubyte *map, const GLuint imageOffsets[],
}
static void
-fetch_srgba_dxt5(const GLubyte *map, const GLuint imageOffsets[],
- GLint rowStride, GLint i, GLint j, GLint k, GLfloat *texel)
+fetch_srgba_dxt5(const GLubyte *map,
+ GLint rowStride, GLint i, GLint j, GLfloat *texel)
{
if (fetch_ext_rgba_dxt5) {
- GLuint sliceOffset = k ? imageOffsets[k] : 0;
GLubyte tex[4];
- fetch_ext_rgba_dxt5(rowStride, map + sliceOffset, i, j, tex);
+ fetch_ext_rgba_dxt5(rowStride, map, i, j, tex);
texel[RCOMP] = _mesa_nonlinear_to_linear(tex[RCOMP]);
texel[GCOMP] = _mesa_nonlinear_to_linear(tex[GCOMP]);
texel[BCOMP] = _mesa_nonlinear_to_linear(tex[BCOMP]);