[PATCH 5/5] wined3d: Add support for EXT_gpu_shader4 provided sampling functions with explicit derivatives.

Stefan Dösinger stefandoesinger at gmx.at
Mon Jan 25 03:38:02 CST 2010


Am 24.01.2010 um 21:16 schrieb Henri Verbeet:
>             if(texrect) {
>                 if(lod) {
>                     sample_function->name = projected ? "texture2DRectProjLod" : "texture2DRectLod";
> -                } else  if(grad) {
> -                    sample_function->name = projected ? "texture2DRectProjGradARB" : "texture2DRectGradARB";
> -                } else {
> +                }
> +                else  if (grad)
> +                {
> +                    if (gl_info->supported[EXT_GPU_SHADER4])
> +                        sample_function->name = projected ? "texture2DRectProjGrad" : "texture2DRectGrad";
> +                    else if (gl_info->supported[ARB_SHADER_TEXTURE_LOD])
> +                        sample_function->name = projected ? "texture2DRectProjGradARB" : "texture2DRectGradARB";
> +                    else
> +                    {
> +                        FIXME("Unsupported RECT grad function.\n");
> +                        sample_function->name = "unsupported2DRectGrad";
> +                    }
> +                }
> +                else
> +                {
>                     sample_function->name = projected ? "texture2DRectProj" : "texture2DRect";
>                 }
>             } else {
I think these if constructs in shader_glsl_get_sample_function are becoming ugly with more and more possibilities added. Isn't there a nicer way, like a table that is either searched, or a multi-dimensional array to look up the end result?




More information about the wine-devel mailing list