i965: translate shadow compare function into correct
internal function to match the EXT_shadow_funs spec. fix bug#11925
This commit is contained in:
parent
ae078e1a0a
commit
a0a5e8cfc0
|
@ -173,7 +173,7 @@ static void brw_update_sampler_state( struct gl_texture_unit *texUnit,
|
|||
* message (sample_c). So need to recompile WM program when
|
||||
* shadow comparison is enabled on each/any texture unit.
|
||||
*/
|
||||
sampler->ss0.shadow_function = intel_translate_compare_func(texObj->CompareFunc);
|
||||
sampler->ss0.shadow_function = intel_translate_shadow_compare_func(texObj->CompareFunc);
|
||||
}
|
||||
|
||||
/* Set LOD bias:
|
||||
|
|
|
@ -464,7 +464,7 @@ extern void intelInitStateFuncs( struct dd_function_table *functions );
|
|||
#define BLENDFACT_INV_CONST_ALPHA 0x0f
|
||||
#define BLENDFACT_MASK 0x0f
|
||||
|
||||
|
||||
extern int intel_translate_shadow_compare_func( GLenum func );
|
||||
extern int intel_translate_compare_func( GLenum func );
|
||||
extern int intel_translate_stencil_op( GLenum op );
|
||||
extern int intel_translate_blend_factor( GLenum factor );
|
||||
|
|
|
@ -38,6 +38,31 @@
|
|||
#include "intel_regions.h"
|
||||
#include "swrast/swrast.h"
|
||||
|
||||
int intel_translate_shadow_compare_func( GLenum func )
|
||||
{
|
||||
switch(func) {
|
||||
case GL_NEVER:
|
||||
return COMPAREFUNC_ALWAYS;
|
||||
case GL_LESS:
|
||||
return COMPAREFUNC_LEQUAL;
|
||||
case GL_LEQUAL:
|
||||
return COMPAREFUNC_LESS;
|
||||
case GL_GREATER:
|
||||
return COMPAREFUNC_GEQUAL;
|
||||
case GL_GEQUAL:
|
||||
return COMPAREFUNC_GREATER;
|
||||
case GL_NOTEQUAL:
|
||||
return COMPAREFUNC_EQUAL;
|
||||
case GL_EQUAL:
|
||||
return COMPAREFUNC_NOTEQUAL;
|
||||
case GL_ALWAYS:
|
||||
return COMPAREFUNC_NEVER;
|
||||
}
|
||||
|
||||
fprintf(stderr, "Unknown value in %s: %x\n", __FUNCTION__, func);
|
||||
return COMPAREFUNC_NEVER;
|
||||
}
|
||||
|
||||
int intel_translate_compare_func( GLenum func )
|
||||
{
|
||||
switch(func) {
|
||||
|
|
Loading…
Reference in New Issue