summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r600
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-10-28 21:24:11 -0600
committerBrian Paul <[email protected]>2009-10-28 21:24:11 -0600
commit1f196b786d6bd0c6a5dbdc638574ff716cc3d4de (patch)
tree5ae2753b99070f8b35c51576bd39e52df63879d6 /src/mesa/drivers/dri/r600
parent0ea575d721821262a862ceef010db9b1a8b4a6d9 (diff)
parent086f9fc0e2aef27f54eda87c733685500555bf20 (diff)
Merge branch 'texformat-rework'
Conflicts: src/mesa/drivers/dri/radeon/radeon_fbo.c src/mesa/drivers/dri/s3v/s3v_tex.c src/mesa/drivers/dri/s3v/s3v_xmesa.c src/mesa/drivers/dri/trident/trident_context.c src/mesa/main/debug.c src/mesa/main/mipmap.c src/mesa/main/texformat.c src/mesa/main/texgetimage.c
Diffstat (limited to 'src/mesa/drivers/dri/r600')
-rw-r--r--src/mesa/drivers/dri/r600/r600_tex.c7
-rw-r--r--src/mesa/drivers/dri/r600/r600_texstate.c15
-rw-r--r--src/mesa/drivers/dri/r600/r700_state.c1
3 files changed, 10 insertions, 13 deletions
diff --git a/src/mesa/drivers/dri/r600/r600_tex.c b/src/mesa/drivers/dri/r600/r600_tex.c
index d105b90cd18..20965bb3c84 100644
--- a/src/mesa/drivers/dri/r600/r600_tex.c
+++ b/src/mesa/drivers/dri/r600/r600_tex.c
@@ -40,7 +40,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/image.h"
#include "main/mipmap.h"
#include "main/simple_list.h"
-#include "main/texformat.h"
#include "main/texstore.h"
#include "main/teximage.h"
#include "main/texobj.h"
@@ -286,6 +285,7 @@ static void r600TexParameter(GLcontext * ctx, GLenum target,
GLenum pname, const GLfloat * params)
{
radeonTexObj* t = radeon_tex_obj(texObj);
+ GLenum baseFormat;
radeon_print(RADEON_STATE | RADEON_TEXTURE, RADEON_VERBOSE,
"%s( %s )\n", __FUNCTION__,
@@ -327,8 +327,9 @@ static void r600TexParameter(GLcontext * ctx, GLenum target,
case GL_DEPTH_TEXTURE_MODE:
if (!texObj->Image[0][texObj->BaseLevel])
return;
- if (texObj->Image[0][texObj->BaseLevel]->TexFormat->BaseFormat
- == GL_DEPTH_COMPONENT) {
+ baseFormat = texObj->Image[0][texObj->BaseLevel]->_BaseFormat;
+ if (baseFormat == GL_DEPTH_COMPONENT ||
+ baseFormat == GL_DEPTH_STENCIL) {
r600SetDepthTexMode(texObj);
break;
} else {
diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c
index ba1371bf95a..c2f2be1d4c8 100644
--- a/src/mesa/drivers/dri/r600/r600_texstate.c
+++ b/src/mesa/drivers/dri/r600/r600_texstate.c
@@ -39,7 +39,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "main/imports.h"
#include "main/context.h"
#include "main/macros.h"
-#include "main/texformat.h"
#include "main/teximage.h"
#include "main/texobj.h"
#include "main/enums.h"
@@ -78,7 +77,7 @@ void r600UpdateTextureState(GLcontext * ctx)
}
}
-static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, GLuint mesa_format)
+static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa_format)
{
radeonTexObj *t = radeon_tex_obj(tObj);
@@ -480,14 +479,14 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, GLuint mesa_fo
SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask);
break;
case MESA_FORMAT_Z16:
- case MESA_FORMAT_Z24_S8:
+ case MESA_FORMAT_S8_Z24:
case MESA_FORMAT_Z32:
switch (mesa_format) {
case MESA_FORMAT_Z16:
SETfield(t->SQ_TEX_RESOURCE1, FMT_16,
SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);
break;
- case MESA_FORMAT_Z24_S8:
+ case MESA_FORMAT_S8_Z24:
SETfield(t->SQ_TEX_RESOURCE1, FMT_24_8,
SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);
break;
@@ -591,7 +590,7 @@ void r600SetDepthTexMode(struct gl_texture_object *tObj)
t = radeon_tex_obj(tObj);
- r600GetTexFormat(tObj, tObj->Image[0][tObj->BaseLevel]->TexFormat->MesaFormat);
+ r600GetTexFormat(tObj, tObj->Image[0][tObj->BaseLevel]->TexFormat);
}
@@ -616,7 +615,7 @@ static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *tex
firstImage = t->base.Image[0][firstlevel];
if (!t->image_override) {
- if (!r600GetTexFormat(texObj, firstImage->TexFormat->MesaFormat)) {
+ if (!r600GetTexFormat(texObj, firstImage->TexFormat)) {
radeon_error("unexpected texture format in %s\n",
__FUNCTION__);
return;
@@ -916,9 +915,7 @@ void r600SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo
_mesa_init_teximage_fields(radeon->glCtx, target, texImage,
rb->base.Width, rb->base.Height, 1, 0, rb->cpp);
texImage->RowStride = rb->pitch / rb->cpp;
- texImage->TexFormat = radeonChooseTextureFormat(radeon->glCtx,
- internalFormat,
- type, format, 0);
+
rImage->bo = rb->bo;
radeon_bo_ref(rImage->bo);
t->bo = rb->bo;
diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c
index 0b676362f85..2b42bfa3f95 100644
--- a/src/mesa/drivers/dri/r600/r700_state.c
+++ b/src/mesa/drivers/dri/r600/r700_state.c
@@ -46,7 +46,6 @@
#include "shader/prog_parameter.h"
#include "shader/prog_statevars.h"
#include "vbo/vbo.h"
-#include "main/texformat.h"
#include "r600_context.h"