#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"
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]);
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]);
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:
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:
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]);
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 &&
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;
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;
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 */
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;
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;
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]);
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]);
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:
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:
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]);
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]);
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:
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:
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]);
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]);
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:
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:
}
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;