X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fatifragshader.c;h=7077c96f1e3d3de2bed52c3664165e30e3334765;hb=17cde55c538009764207bd29b78a909d2c5d14b4;hp=44097e1a266059bf26d695326d802755cce232a1;hpb=9032d2a13ecd019206a48767d9205c0aafa7cca2;p=mesa.git diff --git a/src/mesa/main/atifragshader.c b/src/mesa/main/atifragshader.c index 44097e1a266..7077c96f1e3 100644 --- a/src/mesa/main/atifragshader.c +++ b/src/mesa/main/atifragshader.c @@ -26,39 +26,16 @@ #include "main/hash.h" #include "main/imports.h" #include "main/macros.h" -#include "main/mfeatures.h" #include "main/enums.h" #include "main/mtypes.h" #include "main/dispatch.h" #include "main/atifragshader.h" -#if FEATURE_ATI_fragment_shader - #define MESA_DEBUG_ATI_FS 0 static struct ati_fragment_shader DummyShader; -void -_mesa_init_ati_fragment_shader_dispatch(struct _glapi_table *disp) -{ - SET_GenFragmentShadersATI(disp, _mesa_GenFragmentShadersATI); - SET_BindFragmentShaderATI(disp, _mesa_BindFragmentShaderATI); - SET_DeleteFragmentShaderATI(disp, _mesa_DeleteFragmentShaderATI); - SET_BeginFragmentShaderATI(disp, _mesa_BeginFragmentShaderATI); - SET_EndFragmentShaderATI(disp, _mesa_EndFragmentShaderATI); - SET_PassTexCoordATI(disp, _mesa_PassTexCoordATI); - SET_SampleMapATI(disp, _mesa_SampleMapATI); - SET_ColorFragmentOp1ATI(disp, _mesa_ColorFragmentOp1ATI); - SET_ColorFragmentOp2ATI(disp, _mesa_ColorFragmentOp2ATI); - SET_ColorFragmentOp3ATI(disp, _mesa_ColorFragmentOp3ATI); - SET_AlphaFragmentOp1ATI(disp, _mesa_AlphaFragmentOp1ATI); - SET_AlphaFragmentOp2ATI(disp, _mesa_AlphaFragmentOp2ATI); - SET_AlphaFragmentOp3ATI(disp, _mesa_AlphaFragmentOp3ATI); - SET_SetFragmentShaderConstantATI(disp, _mesa_SetFragmentShaderConstantATI); -} - - /** * Allocate and initialize a new ATI fragment shader object. */ @@ -83,10 +60,8 @@ _mesa_delete_ati_fragment_shader(struct gl_context *ctx, struct ati_fragment_sha { GLuint i; for (i = 0; i < MAX_NUM_PASSES_ATI; i++) { - if (s->Instructions[i]) - free(s->Instructions[i]); - if (s->SetupInst[i]) - free(s->SetupInst[i]); + free(s->Instructions[i]); + free(s->SetupInst[i]); } free(s); } @@ -342,21 +317,17 @@ _mesa_BeginFragmentShaderATI(void) (or, could use the same mem but would need to reinitialize) */ /* no idea if it's allowed to redefine a shader */ for (i = 0; i < MAX_NUM_PASSES_ATI; i++) { - if (ctx->ATIFragmentShader.Current->Instructions[i]) - free(ctx->ATIFragmentShader.Current->Instructions[i]); - if (ctx->ATIFragmentShader.Current->SetupInst[i]) - free(ctx->ATIFragmentShader.Current->SetupInst[i]); + free(ctx->ATIFragmentShader.Current->Instructions[i]); + free(ctx->ATIFragmentShader.Current->SetupInst[i]); } /* malloc the instructions here - not sure if the best place but its a start */ for (i = 0; i < MAX_NUM_PASSES_ATI; i++) { ctx->ATIFragmentShader.Current->Instructions[i] = - (struct atifs_instruction *) calloc(1, sizeof(struct atifs_instruction) * (MAX_NUM_INSTRUCTIONS_PER_PASS_ATI)); ctx->ATIFragmentShader.Current->SetupInst[i] = - (struct atifs_setupinst *) calloc(1, sizeof(struct atifs_setupinst) * (MAX_NUM_FRAGMENT_REGISTERS_ATI)); } @@ -494,7 +465,7 @@ _mesa_PassTexCoordATI(GLuint dst, GLuint coord, GLenum swizzle) } } - curProg->regsAssigned[curProg->cur_pass >> 1] |= 1 << (dst - GL_REG_0_ATI); + curProg->regsAssigned[curProg->cur_pass >> 1] |= 1 << (dst - GL_REG_0_ATI); new_tex_inst(curProg); /* add the instructions */ @@ -567,7 +538,7 @@ _mesa_SampleMapATI(GLuint dst, GLuint interp, GLenum swizzle) } } - curProg->regsAssigned[curProg->cur_pass >> 1] |= 1 << (dst - GL_REG_0_ATI); + curProg->regsAssigned[curProg->cur_pass >> 1] |= 1 << (dst - GL_REG_0_ATI); new_tex_inst(curProg); /* add the instructions */ @@ -792,5 +763,3 @@ _mesa_SetFragmentShaderConstantATI(GLuint dst, const GLfloat * value) COPY_4V(ctx->ATIFragmentShader.GlobalConstants[dstindex], value); } } - -#endif /* FEATURE_ATI_fragment_shader */