Get alpha in textures to work properly.
authorVladimir Dergachev <volodya@freedesktop.org>
Tue, 1 Feb 2005 15:27:36 +0000 (15:27 +0000)
committerVladimir Dergachev <volodya@freedesktop.org>
Tue, 1 Feb 2005 15:27:36 +0000 (15:27 +0000)
src/mesa/drivers/dri/r300/r300_fixed_pipelines.h
src/mesa/drivers/dri/r300/r300_reg.h
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/r300_tex.c

index ab31ec039b6e1fb4460319c4f2fdf3f7a8e47486..55d7bd9e8c9890713035d79521c6a8b300ff292d 100644 (file)
@@ -261,8 +261,16 @@ static struct r300_pixel_shader_state SINGLE_TEXTURE_PIXEL_SHADER={
                                        {
                                        EASY_PFS_INSTR0(MAD, SRC0C_XYZ, SRC1C_XYZ, ZERO), 
                                        EASY_PFS_INSTR1(0, 0, 1, 0 | PFS_FLAG_CONST, NONE, ALL), 
+                                       
+                                       #if 0
+                                       /* no alpha in textures */
                                        EASY_PFS_INSTR2(MAD, SRC0A, ONE, ZERO), 
                                        EASY_PFS_INSTR3(0, 1, 0 | PFS_FLAG_CONST, 0 | PFS_FLAG_CONST, OUTPUT)
+                                       #endif
+                                       
+                                       /* alpha in textures */
+                                       EASY_PFS_INSTR2(MAD, SRC0A, SRC1A, ZERO), 
+                                       EASY_PFS_INSTR3(0, 0, 1, 0 | PFS_FLAG_CONST, OUTPUT)
                                        },
                                        
                                        {
index 6817c594897c7b986c4d2e991d5a469bf8232866..b7e2cca63b38925bd1dda2c9d7ca9963a0884176 100644 (file)
@@ -655,7 +655,7 @@ I am fairly certain that they are correct unless stated otherwise in comments.
 #      define R300_TX_FORMAT_ALPHA_4CH             0x600
 #      define R300_TX_FORMAT_ALPHA_NONE            0xA00
        /* Swizzling */
-       /* constats */
+       /* constants */
 #      define R300_TX_FORMAT_X         0
 #      define R300_TX_FORMAT_Y         1
 #      define R300_TX_FORMAT_Z         2
index 0ac9a2a7965f69bfcd00eda261d7837d017f88ea..3c7f0367b4971db36ec294fb6bb706ebca765d09 100644 (file)
@@ -209,6 +209,9 @@ static void r300_set_blend_cntl(r300ContextPtr rmesa, int func, int eqn, int cbi
 {
        GLuint new_ablend, new_cblend;
 
+       #if 0
+       fprintf(stderr, "eqnA=%08x funcA=%08x eqn=%08x func=%08x cbits=%08x\n", eqnA, funcA, eqn, func, cbits);
+       #endif
        new_ablend = eqnA | funcA;
        new_cblend = eqn | func;
        if(funcA == func){
index 8ea9b7f6bdb7893da06e4573a0513a43d32f0679..b81b7e64c6bc6ccb7f45887f1ad7504381133b3c 100644 (file)
@@ -318,10 +318,12 @@ static const struct gl_texture_format *r300ChooseTextureFormat(GLcontext * ctx,
        (void)format;
        
        #if 0
-       fprintf(stderr, "InternalFormat=%s type=%s format=%s\n", 
-               _mesa_lookup_enum_by_nr(internalFormat),
+       fprintf(stderr, "InternalFormat=%s(%d) type=%s format=%s\n", 
+               _mesa_lookup_enum_by_nr(internalFormat), internalFormat,
                _mesa_lookup_enum_by_nr(type),
                _mesa_lookup_enum_by_nr(format));
+       fprintf(stderr, "do32bpt=%d force16bpt=%d\n",   
+               do32bpt, force16bpt);
        #endif
        
        switch (internalFormat) {