2 * Copyright (C) 2008-2009 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 * Richard Li <RichardZ.Li@amd.com>, <richardradeon@gmail.com>
27 #ifndef __r700_TEX_H__
28 #define __r700_TEX_H__
32 #include "r700_chip.h"
34 /* TODO : review this after texture load code. */
35 #define R700_BLIT_WIDTH_BYTES 1024
36 /* The BASE_ADDRESS and MIP_ADDRESS fields are 256-byte-aligned */
37 #define R700_TEXTURE_ALIGNMENT_MASK 0x255
38 /* Texel pitch is 8 alignment. */
39 #define R700_TEXEL_PITCH_ALIGNMENT_MASK 0x7
41 #define R700_MAX_TEXTURE_UNITS 8 /* TODO : should be 16, lets make it work, review later */
43 typedef struct r700_tex_obj r700TexObj
, *r700TexObjPtr
;
45 /* Texture object in locally shared texture space.
49 driTextureObject base
;
53 GLboolean image_override
;
63 GLboolean border_fallback
;
66 /* r700 texture states */
67 TEXTURE_STATE_STRUCT texture_state
;
68 SAMPLER_STATE_STRUCT sampler_state
;
70 GLuint texel_pitch
[6][RADEON_MAX_TEXTURE_LEVELS
];
71 GLuint level_offset
[6][RADEON_MAX_TEXTURE_LEVELS
];
72 GLuint byte_per_texel
;
73 GLuint src_width_in_pexel
[6][RADEON_MAX_TEXTURE_LEVELS
];
74 GLuint src_hight_in_pexel
[6][RADEON_MAX_TEXTURE_LEVELS
];
76 GLuint my_dirty_images
[6]; /* TODO : review */
79 extern void r700SetTexBuffer(__DRIcontext
*pDRICtx
, GLint target
,
80 __DRIdrawable
*dPriv
);
82 extern void r700SetTexBuffer2(__DRIcontext
*pDRICtx
, GLint target
,
83 GLint format
, __DRIdrawable
*dPriv
);
85 extern void r700SetTexOffset(__DRIcontext
*pDRICtx
, GLint texname
,
86 unsigned long long offset
, GLint depth
,
89 extern GLuint
r700GetTexObjSize(void);
90 extern void r700UpdateTextureState(context_t
* context
);
92 extern void r700SetTexOffset(__DRIcontext
*pDRICtx
,
94 unsigned long long offset
,
98 extern void r700DestroyTexObj(context_t rmesa
, r700TexObjPtr t
);
100 extern GLboolean
r700ValidateBuffers(GLcontext
* ctx
);
102 extern void r700InitTextureFuncs(struct dd_function_table
*functions
);
104 #endif /* __r700_TEX_H__ */