Re: [PATCH 5/5] wined3d: Add support for EXT_gpu_shader4 provided sampling functions with explicit derivatives.
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?
On 25 January 2010 10:38, Stefan Dösinger <stefandoesinger(a)gmx.at> wrote:
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?
Yeah, we could replace it with a lookup table at some point.
participants (2)
-
Henri Verbeet -
Stefan Dösinger