aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/swrast/s_texfilter.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2015-02-22 14:31:16 +0100
committermarha <marha@users.sourceforge.net>2015-02-22 14:31:16 +0100
commitf1c2db43dcf35d2cf4715390bd2391c28e42a8c2 (patch)
tree46b537271afe0f6534231b1bd4cc4f91ae1fb446 /mesalib/src/mesa/swrast/s_texfilter.c
parent5e5a48ff8cd08f123601cd0625ca62a86675aac9 (diff)
downloadvcxsrv-f1c2db43dcf35d2cf4715390bd2391c28e42a8c2.tar.gz
vcxsrv-f1c2db43dcf35d2cf4715390bd2391c28e42a8c2.tar.bz2
vcxsrv-f1c2db43dcf35d2cf4715390bd2391c28e42a8c2.zip
xwininfo fontconfig libX11 libXdmcp libfontenc libxcb libxcb/xcb-proto mesalib xserver xkeyboard-config mkfontscale git update 22 Feb 2015
xserver commit 3a06faf3fcdb7451125a46181f9152e8e59e9770 libxcb commit e3ec1f74637237ce500dfd0ca59f2e422da4e019 libxcb/xcb-proto commit 4c550465934164aab2449a125f75f4ca07816233 xkeyboard-config commit 26f344c93f8c6141e9233eb68088ba4fd56bc9ef libX11 commit c8e19b393defd53f046ddc2da3a16881221b3c34 libXdmcp commit 9f4cac7656b221ce2a8f97e7bd31e5e23126d001 libfontenc commit de1843aaf76015c9d99416f3122d169fe331b849 mkfontscale commit 87d628f8eec170ec13bb9feefb1ce05aed07d1d6 xwininfo commit 0c49f8f2bd56b1e77721e81030ea948386dcdf4e fontconfig commit d6d5adeb7940c0d0beb86489c2a1c2ce59e5c044 mesa commit 4359954d842caa2a9f8d4b50d70ecc789884b68b
Diffstat (limited to 'mesalib/src/mesa/swrast/s_texfilter.c')
-rw-r--r--mesalib/src/mesa/swrast/s_texfilter.c69
1 files changed, 35 insertions, 34 deletions
diff --git a/mesalib/src/mesa/swrast/s_texfilter.c b/mesalib/src/mesa/swrast/s_texfilter.c
index faeccae7c..fa79fdc5b 100644
--- a/mesalib/src/mesa/swrast/s_texfilter.c
+++ b/mesalib/src/mesa/swrast/s_texfilter.c
@@ -27,8 +27,9 @@
#include "main/context.h"
#include "main/colormac.h"
#include "main/imports.h"
-#include "main/texobj.h"
#include "main/samplerobj.h"
+#include "main/teximage.h"
+#include "main/texobj.h"
#include "s_context.h"
#include "s_texfilter.h"
@@ -832,7 +833,7 @@ apply_depth_mode(GLenum depthMode, GLfloat z, GLfloat texel[4])
static GLboolean
is_depth_texture(const struct gl_texture_object *tObj)
{
- GLenum format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat;
+ GLenum format = _mesa_texture_base_format(tObj);
return format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT;
}
@@ -1004,7 +1005,7 @@ sample_nearest_1d( struct gl_context *ctx,
GLfloat rgba[][4] )
{
GLuint i;
- struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
+ const struct gl_texture_image *image = _mesa_base_tex_image(tObj);
(void) lambda;
for (i = 0; i < n; i++) {
sample_1d_nearest(ctx, samp, image, texcoords[i], rgba[i]);
@@ -1021,7 +1022,7 @@ sample_linear_1d( struct gl_context *ctx,
GLfloat rgba[][4] )
{
GLuint i;
- struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
+ const struct gl_texture_image *image = _mesa_base_tex_image(tObj);
(void) lambda;
for (i = 0; i < n; i++) {
sample_1d_linear(ctx, samp, image, texcoords[i], rgba[i]);
@@ -1051,12 +1052,12 @@ sample_lambda_1d( struct gl_context *ctx,
switch (samp->MinFilter) {
case GL_NEAREST:
for (i = minStart; i < minEnd; i++)
- sample_1d_nearest(ctx, samp, tObj->Image[0][tObj->BaseLevel],
+ sample_1d_nearest(ctx, samp, _mesa_base_tex_image(tObj),
texcoords[i], rgba[i]);
break;
case GL_LINEAR:
for (i = minStart; i < minEnd; i++)
- sample_1d_linear(ctx, samp, tObj->Image[0][tObj->BaseLevel],
+ sample_1d_linear(ctx, samp, _mesa_base_tex_image(tObj),
texcoords[i], rgba[i]);
break;
case GL_NEAREST_MIPMAP_NEAREST:
@@ -1086,12 +1087,12 @@ sample_lambda_1d( struct gl_context *ctx,
switch (samp->MagFilter) {
case GL_NEAREST:
for (i = magStart; i < magEnd; i++)
- sample_1d_nearest(ctx, samp, tObj->Image[0][tObj->BaseLevel],
+ sample_1d_nearest(ctx, samp, _mesa_base_tex_image(tObj),
texcoords[i], rgba[i]);
break;
case GL_LINEAR:
for (i = magStart; i < magEnd; i++)
- sample_1d_linear(ctx, samp, tObj->Image[0][tObj->BaseLevel],
+ sample_1d_linear(ctx, samp, _mesa_base_tex_image(tObj),
texcoords[i], rgba[i]);
break;
default:
@@ -1364,7 +1365,7 @@ sample_nearest_2d(struct gl_context *ctx,
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
+ const struct gl_texture_image *image = _mesa_base_tex_image(tObj);
(void) lambda;
for (i = 0; i < n; i++) {
sample_2d_nearest(ctx, samp, image, texcoords[i], rgba[i]);
@@ -1381,7 +1382,7 @@ sample_linear_2d(struct gl_context *ctx,
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
+ const struct gl_texture_image *image = _mesa_base_tex_image(tObj);
const struct swrast_texture_image *swImg = swrast_texture_image_const(image);
(void) lambda;
if (samp->WrapS == GL_REPEAT &&
@@ -1415,7 +1416,7 @@ opt_sample_rgb_2d(struct gl_context *ctx,
GLuint n, const GLfloat texcoords[][4],
const GLfloat lambda[], GLfloat rgba[][4])
{
- const struct gl_texture_image *img = tObj->Image[0][tObj->BaseLevel];
+ const struct gl_texture_image *img = _mesa_base_tex_image(tObj);
const struct swrast_texture_image *swImg = swrast_texture_image_const(img);
const GLfloat width = (GLfloat) img->Width;
const GLfloat height = (GLfloat) img->Height;
@@ -1460,7 +1461,7 @@ opt_sample_rgba_2d(struct gl_context *ctx,
GLuint n, const GLfloat texcoords[][4],
const GLfloat lambda[], GLfloat rgba[][4])
{
- const struct gl_texture_image *img = tObj->Image[0][tObj->BaseLevel];
+ const struct gl_texture_image *img = _mesa_base_tex_image(tObj);
const struct swrast_texture_image *swImg = swrast_texture_image_const(img);
const GLfloat width = (GLfloat) img->Width;
const GLfloat height = (GLfloat) img->Height;
@@ -1498,7 +1499,7 @@ sample_lambda_2d(struct gl_context *ctx,
GLuint n, const GLfloat texcoords[][4],
const GLfloat lambda[], GLfloat rgba[][4])
{
- const struct gl_texture_image *tImg = tObj->Image[0][tObj->BaseLevel];
+ const struct gl_texture_image *tImg = _mesa_base_tex_image(tObj);
const struct swrast_texture_image *swImg = swrast_texture_image_const(tImg);
GLuint minStart, minEnd; /* texels with minification */
GLuint magStart, magEnd; /* texels with magnification */
@@ -1653,7 +1654,7 @@ sample_2d_ewa(struct gl_context *ctx,
GLfloat scaling = 1.0f / (1 << level);
const struct gl_texture_image *img = tObj->Image[0][level];
const struct gl_texture_image *mostDetailedImage =
- tObj->Image[0][tObj->BaseLevel];
+ _mesa_base_tex_image(tObj);
const struct swrast_texture_image *swImg =
swrast_texture_image_const(mostDetailedImage);
GLfloat tex_u = -0.5f + texcoord[0] * swImg->WidthScale * scaling;
@@ -1865,7 +1866,7 @@ sample_lambda_2d_aniso(struct gl_context *ctx,
GLuint n, const GLfloat texcoords[][4],
const GLfloat lambda_iso[], GLfloat rgba[][4])
{
- const struct gl_texture_image *tImg = tObj->Image[0][tObj->BaseLevel];
+ const struct gl_texture_image *tImg = _mesa_base_tex_image(tObj);
const struct swrast_texture_image *swImg = swrast_texture_image_const(tImg);
const GLfloat maxEccentricity =
samp->MaxAnisotropy * samp->MaxAnisotropy;
@@ -2232,7 +2233,7 @@ sample_nearest_3d(struct gl_context *ctx,
GLfloat rgba[][4])
{
GLuint i;
- struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
+ const struct gl_texture_image *image = _mesa_base_tex_image(tObj);
(void) lambda;
for (i = 0; i < n; i++) {
sample_3d_nearest(ctx, samp, image, texcoords[i], rgba[i]);
@@ -2249,7 +2250,7 @@ sample_linear_3d(struct gl_context *ctx,
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
+ const struct gl_texture_image *image = _mesa_base_tex_image(tObj);
(void) lambda;
for (i = 0; i < n; i++) {
sample_3d_linear(ctx, samp, image, texcoords[i], rgba[i]);
@@ -2279,12 +2280,12 @@ sample_lambda_3d(struct gl_context *ctx,
switch (samp->MinFilter) {
case GL_NEAREST:
for (i = minStart; i < minEnd; i++)
- sample_3d_nearest(ctx, samp, tObj->Image[0][tObj->BaseLevel],
+ sample_3d_nearest(ctx, samp, _mesa_base_tex_image(tObj),
texcoords[i], rgba[i]);
break;
case GL_LINEAR:
for (i = minStart; i < minEnd; i++)
- sample_3d_linear(ctx, samp, tObj->Image[0][tObj->BaseLevel],
+ sample_3d_linear(ctx, samp, _mesa_base_tex_image(tObj),
texcoords[i], rgba[i]);
break;
case GL_NEAREST_MIPMAP_NEAREST:
@@ -2314,12 +2315,12 @@ sample_lambda_3d(struct gl_context *ctx,
switch (samp->MagFilter) {
case GL_NEAREST:
for (i = magStart; i < magEnd; i++)
- sample_3d_nearest(ctx, samp, tObj->Image[0][tObj->BaseLevel],
+ sample_3d_nearest(ctx, samp, _mesa_base_tex_image(tObj),
texcoords[i], rgba[i]);
break;
case GL_LINEAR:
for (i = magStart; i < magEnd; i++)
- sample_3d_linear(ctx, samp, tObj->Image[0][tObj->BaseLevel],
+ sample_3d_linear(ctx, samp, _mesa_base_tex_image(tObj),
texcoords[i], rgba[i]);
break;
default:
@@ -3020,7 +3021,7 @@ sample_nearest_2d_array(struct gl_context *ctx,
GLfloat rgba[][4])
{
GLuint i;
- struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
+ const struct gl_texture_image *image = _mesa_base_tex_image(tObj);
(void) lambda;
for (i = 0; i < n; i++) {
sample_2d_array_nearest(ctx, samp, image, texcoords[i], rgba[i]);
@@ -3038,7 +3039,7 @@ sample_linear_2d_array(struct gl_context *ctx,
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
+ const struct gl_texture_image *image = _mesa_base_tex_image(tObj);
(void) lambda;
for (i = 0; i < n; i++) {
sample_2d_array_linear(ctx, samp, image, texcoords[i], rgba[i]);
@@ -3068,12 +3069,12 @@ sample_lambda_2d_array(struct gl_context *ctx,
switch (samp->MinFilter) {
case GL_NEAREST:
for (i = minStart; i < minEnd; i++)
- sample_2d_array_nearest(ctx, samp, tObj->Image[0][tObj->BaseLevel],
+ sample_2d_array_nearest(ctx, samp, _mesa_base_tex_image(tObj),
texcoords[i], rgba[i]);
break;
case GL_LINEAR:
for (i = minStart; i < minEnd; i++)
- sample_2d_array_linear(ctx, samp, tObj->Image[0][tObj->BaseLevel],
+ sample_2d_array_linear(ctx, samp, _mesa_base_tex_image(tObj),
texcoords[i], rgba[i]);
break;
case GL_NEAREST_MIPMAP_NEAREST:
@@ -3111,12 +3112,12 @@ sample_lambda_2d_array(struct gl_context *ctx,
switch (samp->MagFilter) {
case GL_NEAREST:
for (i = magStart; i < magEnd; i++)
- sample_2d_array_nearest(ctx, samp, tObj->Image[0][tObj->BaseLevel],
+ sample_2d_array_nearest(ctx, samp, _mesa_base_tex_image(tObj),
texcoords[i], rgba[i]);
break;
case GL_LINEAR:
for (i = magStart; i < magEnd; i++)
- sample_2d_array_linear(ctx, samp, tObj->Image[0][tObj->BaseLevel],
+ sample_2d_array_linear(ctx, samp, _mesa_base_tex_image(tObj),
texcoords[i], rgba[i]);
break;
default:
@@ -3311,7 +3312,7 @@ sample_nearest_1d_array(struct gl_context *ctx,
GLfloat rgba[][4])
{
GLuint i;
- struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
+ const struct gl_texture_image *image = _mesa_base_tex_image(tObj);
(void) lambda;
for (i = 0; i < n; i++) {
sample_1d_array_nearest(ctx, samp, image, texcoords[i], rgba[i]);
@@ -3328,7 +3329,7 @@ sample_linear_1d_array(struct gl_context *ctx,
const GLfloat lambda[], GLfloat rgba[][4])
{
GLuint i;
- struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
+ const struct gl_texture_image *image = _mesa_base_tex_image(tObj);
(void) lambda;
for (i = 0; i < n; i++) {
sample_1d_array_linear(ctx, samp, image, texcoords[i], rgba[i]);
@@ -3358,12 +3359,12 @@ sample_lambda_1d_array(struct gl_context *ctx,
switch (samp->MinFilter) {
case GL_NEAREST:
for (i = minStart; i < minEnd; i++)
- sample_1d_array_nearest(ctx, samp, tObj->Image[0][tObj->BaseLevel],
+ sample_1d_array_nearest(ctx, samp, _mesa_base_tex_image(tObj),
texcoords[i], rgba[i]);
break;
case GL_LINEAR:
for (i = minStart; i < minEnd; i++)
- sample_1d_array_linear(ctx, samp, tObj->Image[0][tObj->BaseLevel],
+ sample_1d_array_linear(ctx, samp, _mesa_base_tex_image(tObj),
texcoords[i], rgba[i]);
break;
case GL_NEAREST_MIPMAP_NEAREST:
@@ -3397,12 +3398,12 @@ sample_lambda_1d_array(struct gl_context *ctx,
switch (samp->MagFilter) {
case GL_NEAREST:
for (i = magStart; i < magEnd; i++)
- sample_1d_array_nearest(ctx, samp, tObj->Image[0][tObj->BaseLevel],
+ sample_1d_array_nearest(ctx, samp, _mesa_base_tex_image(tObj),
texcoords[i], rgba[i]);
break;
case GL_LINEAR:
for (i = magStart; i < magEnd; i++)
- sample_1d_array_linear(ctx, samp, tObj->Image[0][tObj->BaseLevel],
+ sample_1d_array_linear(ctx, samp, _mesa_base_tex_image(tObj),
texcoords[i], rgba[i]);
break;
default:
@@ -3749,7 +3750,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx,
}
else {
/* check for a few optimized cases */
- const struct gl_texture_image *img = t->Image[0][t->BaseLevel];
+ const struct gl_texture_image *img = _mesa_base_tex_image(t);
const struct swrast_texture_image *swImg =
swrast_texture_image_const(img);
texture_sample_func func;