projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
i965: Resolve GCC sign-compare warning.
[mesa.git]
/
src
/
mesa
/
drivers
/
dri
/
r200
/
r200_fragshader.c
diff --git
a/src/mesa/drivers/dri/r200/r200_fragshader.c
b/src/mesa/drivers/dri/r200/r200_fragshader.c
index 85c1b7bdd19426bcdb5072abe15373a0b77874d2..ca772f1c8728383caff91703c2ec912060c75a5e 100644
(file)
--- a/
src/mesa/drivers/dri/r200/r200_fragshader.c
+++ b/
src/mesa/drivers/dri/r200/r200_fragshader.c
@@
-26,11
+26,11
@@
**************************************************************************/
#include "main/glheader.h"
**************************************************************************/
#include "main/glheader.h"
+#include "main/atifragshader.h"
#include "main/macros.h"
#include "main/enums.h"
#include "tnl/t_context.h"
#include "main/macros.h"
#include "main/enums.h"
#include "tnl/t_context.h"
-#include "shader/atifragshader.h"
-#include "shader/program.h"
+#include "program/program.h"
#include "r200_context.h"
#include "r200_ioctl.h"
#include "r200_tex.h"
#include "r200_context.h"
#include "r200_ioctl.h"
#include "r200_tex.h"
@@
-121,7
+121,7
@@
static GLuint dstmask_table[8] =
R200_TXC_OUTPUT_MASK_RGB
};
R200_TXC_OUTPUT_MASK_RGB
};
-static void r200UpdateFSArith(
GL
context *ctx )
+static void r200UpdateFSArith(
struct gl_
context *ctx )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
GLuint *afs_cmd;
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
GLuint *afs_cmd;
@@
-322,7
+322,7
@@
static void r200UpdateFSArith( GLcontext *ctx )
rmesa->afs_loaded = ctx->ATIFragmentShader.Current;
}
rmesa->afs_loaded = ctx->ATIFragmentShader.Current;
}
-static void r200UpdateFSRouting(
GL
context *ctx ) {
+static void r200UpdateFSRouting(
struct gl_
context *ctx ) {
r200ContextPtr rmesa = R200_CONTEXT(ctx);
const struct ati_fragment_shader *shader = ctx->ATIFragmentShader.Current;
GLuint reg;
r200ContextPtr rmesa = R200_CONTEXT(ctx);
const struct ati_fragment_shader *shader = ctx->ATIFragmentShader.Current;
GLuint reg;
@@
-362,7
+362,7
@@
static void r200UpdateFSRouting( GLcontext *ctx ) {
if (shader->NumPasses < 2) {
for (reg = 0; reg < R200_MAX_TEXTURE_UNITS; reg++) {
if (shader->NumPasses < 2) {
for (reg = 0; reg < R200_MAX_TEXTURE_UNITS; reg++) {
-
GLbitfield targetbit = ctx->Texture.Unit[reg]._ReallyEnabled
;
+
struct gl_texture_object *texObj = ctx->Texture.Unit[reg]._Current
;
R200_STATECHANGE( rmesa, tex[reg] );
rmesa->hw.tex[reg].cmd[TEX_PP_TXMULTI_CTL] = 0;
if (shader->SetupInst[0][reg].Opcode) {
R200_STATECHANGE( rmesa, tex[reg] );
rmesa->hw.tex[reg].cmd[TEX_PP_TXMULTI_CTL] = 0;
if (shader->SetupInst[0][reg].Opcode) {
@@
-387,10
+387,10
@@
static void r200UpdateFSRouting( GLcontext *ctx ) {
}
rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
}
}
rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
}
- else if (t
argetbit == TEXTURE_3D_BIT
) {
+ else if (t
exObj && texObj->Target == GL_TEXTURE_3D
) {
txformat_x |= R200_TEXCOORD_VOLUME;
}
txformat_x |= R200_TEXCOORD_VOLUME;
}
- else if (t
argetbit == TEXTURE_CUBE_BIT
) {
+ else if (t
exObj && texObj->Target == GL_TEXTURE_CUBE_MAP
) {
txformat_x |= R200_TEXCOORD_CUBIC_ENV;
}
else if (shader->SetupInst[0][reg].swizzle == GL_SWIZZLE_STR_ATI ||
txformat_x |= R200_TEXCOORD_CUBIC_ENV;
}
else if (shader->SetupInst[0][reg].swizzle == GL_SWIZZLE_STR_ATI ||
@@
-403,7
+403,7
@@
static void r200UpdateFSRouting( GLcontext *ctx ) {
rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT] = txformat;
rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT_X] = txformat_x;
/* enabling texturing when unit isn't correctly configured may not be safe */
rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT] = txformat;
rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT_X] = txformat_x;
/* enabling texturing when unit isn't correctly configured may not be safe */
- if (t
argetbit
)
+ if (t
exObj
)
rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
}
}
rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
}
}
@@
-411,7
+411,7
@@
static void r200UpdateFSRouting( GLcontext *ctx ) {
} else {
/* setup 1st pass */
for (reg = 0; reg < R200_MAX_TEXTURE_UNITS; reg++) {
} else {
/* setup 1st pass */
for (reg = 0; reg < R200_MAX_TEXTURE_UNITS; reg++) {
-
GLbitfield targetbit = ctx->Texture.Unit[reg]._ReallyEnabled
;
+
struct gl_texture_object *texObj = ctx->Texture.Unit[reg]._Current
;
R200_STATECHANGE( rmesa, tex[reg] );
GLuint txformat_multi = 0;
if (shader->SetupInst[0][reg].Opcode) {
R200_STATECHANGE( rmesa, tex[reg] );
GLuint txformat_multi = 0;
if (shader->SetupInst[0][reg].Opcode) {
@@
-428,10
+428,10
@@
static void r200UpdateFSRouting( GLcontext *ctx ) {
}
rmesa->hw.cst.cmd[CST_PP_CNTL_X] |= R200_PPX_TEX_0_ENABLE << reg;
}
}
rmesa->hw.cst.cmd[CST_PP_CNTL_X] |= R200_PPX_TEX_0_ENABLE << reg;
}
- else if (t
argetbit == TEXTURE_3D_BIT
) {
+ else if (t
exObj && texObj->Target == GL_TEXTURE_3D
) {
txformat_multi |= R200_PASS1_TEXCOORD_VOLUME;
}
txformat_multi |= R200_PASS1_TEXCOORD_VOLUME;
}
- else if (t
argetbit == TEXTURE_CUBE_BIT
) {
+ else if (t
exObj && texObj->Target == GL_TEXTURE_CUBE_MAP
) {
txformat_multi |= R200_PASS1_TEXCOORD_CUBIC_ENV;
}
else if (shader->SetupInst[0][reg].swizzle == GL_SWIZZLE_STR_ATI ||
txformat_multi |= R200_PASS1_TEXCOORD_CUBIC_ENV;
}
else if (shader->SetupInst[0][reg].swizzle == GL_SWIZZLE_STR_ATI ||
@@
-441,7
+441,7
@@
static void r200UpdateFSRouting( GLcontext *ctx ) {
else {
txformat_multi |= R200_PASS1_TEXCOORD_PROJ;
}
else {
txformat_multi |= R200_PASS1_TEXCOORD_PROJ;
}
- if (t
argetbit
)
+ if (t
exObj
)
rmesa->hw.cst.cmd[CST_PP_CNTL_X] |= R200_PPX_TEX_0_ENABLE << reg;
}
rmesa->hw.tex[reg].cmd[TEX_PP_TXMULTI_CTL] = txformat_multi;
rmesa->hw.cst.cmd[CST_PP_CNTL_X] |= R200_PPX_TEX_0_ENABLE << reg;
}
rmesa->hw.tex[reg].cmd[TEX_PP_TXMULTI_CTL] = txformat_multi;
@@
-449,7
+449,7
@@
static void r200UpdateFSRouting( GLcontext *ctx ) {
/* setup 2nd pass */
for (reg=0; reg < R200_MAX_TEXTURE_UNITS; reg++) {
/* setup 2nd pass */
for (reg=0; reg < R200_MAX_TEXTURE_UNITS; reg++) {
-
GLbitfield targetbit = ctx->Texture.Unit[reg]._ReallyEnabled
;
+
struct gl_texture_object *texObj = ctx->Texture.Unit[reg]._Current
;
if (shader->SetupInst[1][reg].Opcode) {
GLuint coord = shader->SetupInst[1][reg].src;
GLuint txformat = rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT]
if (shader->SetupInst[1][reg].Opcode) {
GLuint coord = shader->SetupInst[1][reg].src;
GLuint txformat = rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT]
@@
-468,10
+468,10
@@
static void r200UpdateFSRouting( GLcontext *ctx ) {
}
rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
}
}
rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
}
- else if (t
argetbit == TEXTURE_3D_BIT
) {
+ else if (t
exObj && texObj->Target == GL_TEXTURE_3D
) {
txformat_x |= R200_TEXCOORD_VOLUME;
}
txformat_x |= R200_TEXCOORD_VOLUME;
}
- else if (t
argetbit == TEXTURE_CUBE_BIT
) {
+ else if (t
exObj && texObj->Target == GL_TEXTURE_CUBE_MAP
) {
txformat_x |= R200_TEXCOORD_CUBIC_ENV;
}
else if (shader->SetupInst[1][reg].swizzle == GL_SWIZZLE_STR_ATI ||
txformat_x |= R200_TEXCOORD_CUBIC_ENV;
}
else if (shader->SetupInst[1][reg].swizzle == GL_SWIZZLE_STR_ATI ||
@@
-492,14
+492,14
@@
static void r200UpdateFSRouting( GLcontext *ctx ) {
}
rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT_X] = txformat_x;
rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT] = txformat;
}
rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT_X] = txformat_x;
rmesa->hw.tex[reg].cmd[TEX_PP_TXFORMAT] = txformat;
- if (t
argetbit
)
+ if (t
exObj
)
rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
}
}
}
}
rmesa->hw.ctx.cmd[CTX_PP_CNTL] |= R200_TEX_0_ENABLE << reg;
}
}
}
}
-static void r200UpdateFSConstants(
GL
context *ctx )
+static void r200UpdateFSConstants(
struct gl_
context *ctx )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
const struct ati_fragment_shader *shader = ctx->ATIFragmentShader.Current;
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
const struct ati_fragment_shader *shader = ctx->ATIFragmentShader.Current;
@@
-537,7
+537,7
@@
static void r200UpdateFSConstants( GLcontext *ctx )
* stored in some DriverData object attached to the mesa atifs object, i.e. binding a
* shader wouldn't force us to "recompile" the shader).
*/
* stored in some DriverData object attached to the mesa atifs object, i.e. binding a
* shader wouldn't force us to "recompile" the shader).
*/
-void r200UpdateFragmentShader(
GL
context *ctx )
+void r200UpdateFragmentShader(
struct gl_
context *ctx )
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);