1bf215546Sopenharmony_ci/************************************************************************** 2bf215546Sopenharmony_ci * 3bf215546Sopenharmony_ci * Copyright 2010-2021 VMware, Inc. 4bf215546Sopenharmony_ci * All Rights Reserved. 5bf215546Sopenharmony_ci * 6bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a 7bf215546Sopenharmony_ci * copy of this software and associated documentation files (the 8bf215546Sopenharmony_ci * "Software"), to deal in the Software without restriction, including 9bf215546Sopenharmony_ci * without limitation the rights to use, copy, modify, merge, publish, 10bf215546Sopenharmony_ci * distribute, sub license, and/or sell copies of the Software, and to 11bf215546Sopenharmony_ci * permit persons to whom the Software is furnished to do so, subject to 12bf215546Sopenharmony_ci * the following conditions: 13bf215546Sopenharmony_ci * 14bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15bf215546Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 17bf215546Sopenharmony_ci * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, 18bf215546Sopenharmony_ci * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 19bf215546Sopenharmony_ci * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 20bf215546Sopenharmony_ci * USE OR OTHER DEALINGS IN THE SOFTWARE. 21bf215546Sopenharmony_ci * 22bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the 23bf215546Sopenharmony_ci * next paragraph) shall be included in all copies or substantial portions 24bf215546Sopenharmony_ci * of the Software. 25bf215546Sopenharmony_ci * 26bf215546Sopenharmony_ci **************************************************************************/ 27bf215546Sopenharmony_ci 28bf215546Sopenharmony_ci 29bf215546Sopenharmony_ci#include "pipe/p_config.h" 30bf215546Sopenharmony_ci 31bf215546Sopenharmony_ci#include "util/u_math.h" 32bf215546Sopenharmony_ci#include "util/u_cpu_detect.h" 33bf215546Sopenharmony_ci#include "util/u_pack_color.h" 34bf215546Sopenharmony_ci#include "util/u_rect.h" 35bf215546Sopenharmony_ci#include "util/u_sse.h" 36bf215546Sopenharmony_ci 37bf215546Sopenharmony_ci#include "lp_jit.h" 38bf215546Sopenharmony_ci#include "lp_rast.h" 39bf215546Sopenharmony_ci#include "lp_debug.h" 40bf215546Sopenharmony_ci#include "lp_state_fs.h" 41bf215546Sopenharmony_ci#include "lp_linear_priv.h" 42bf215546Sopenharmony_ci 43bf215546Sopenharmony_ci 44bf215546Sopenharmony_ci#if defined(PIPE_ARCH_SSE) 45bf215546Sopenharmony_ci 46bf215546Sopenharmony_ci 47bf215546Sopenharmony_ci/* For debugging (LP_DEBUG=linear), shade areas of run-time fallback 48bf215546Sopenharmony_ci * purple. Keep blending active so we can see more of what's going 49bf215546Sopenharmony_ci * on. 50bf215546Sopenharmony_ci */ 51bf215546Sopenharmony_cistatic boolean 52bf215546Sopenharmony_cilinear_fallback(const struct lp_rast_state *state, 53bf215546Sopenharmony_ci unsigned x, unsigned y, 54bf215546Sopenharmony_ci unsigned width, unsigned height, 55bf215546Sopenharmony_ci uint8_t *color, 56bf215546Sopenharmony_ci unsigned stride) 57bf215546Sopenharmony_ci{ 58bf215546Sopenharmony_ci unsigned col = 0x808000ff; 59bf215546Sopenharmony_ci int i; 60bf215546Sopenharmony_ci 61bf215546Sopenharmony_ci for (y = 0; y < height; y++) { 62bf215546Sopenharmony_ci for (i = 0; i < 64; i++) { 63bf215546Sopenharmony_ci *((uint32_t *)(color + y*stride) + x + i) = col; 64bf215546Sopenharmony_ci } 65bf215546Sopenharmony_ci } 66bf215546Sopenharmony_ci 67bf215546Sopenharmony_ci return TRUE; 68bf215546Sopenharmony_ci} 69bf215546Sopenharmony_ci 70bf215546Sopenharmony_ci 71bf215546Sopenharmony_ci/* 72bf215546Sopenharmony_ci * Run our configurable linear shader pipeline: 73bf215546Sopenharmony_ci * x,y is the surface position of the linear region, width, height is the size. 74bf215546Sopenharmony_ci * Return TRUE for success, FALSE otherwise. 75bf215546Sopenharmony_ci */ 76bf215546Sopenharmony_cistatic boolean 77bf215546Sopenharmony_cilp_fs_linear_run(const struct lp_rast_state *state, 78bf215546Sopenharmony_ci unsigned x, unsigned y, 79bf215546Sopenharmony_ci unsigned width, unsigned height, 80bf215546Sopenharmony_ci const float (*a0)[4], 81bf215546Sopenharmony_ci const float (*dadx)[4], 82bf215546Sopenharmony_ci const float (*dady)[4], 83bf215546Sopenharmony_ci uint8_t *color, 84bf215546Sopenharmony_ci unsigned stride) 85bf215546Sopenharmony_ci{ 86bf215546Sopenharmony_ci const struct lp_fragment_shader_variant *variant = state->variant; 87bf215546Sopenharmony_ci const struct lp_tgsi_info *info = &variant->shader->info; 88bf215546Sopenharmony_ci uint8_t constants[LP_MAX_LINEAR_CONSTANTS * 4]; 89bf215546Sopenharmony_ci 90bf215546Sopenharmony_ci LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__); 91bf215546Sopenharmony_ci 92bf215546Sopenharmony_ci /* Require constant w in these rectangles: 93bf215546Sopenharmony_ci */ 94bf215546Sopenharmony_ci if (dadx[0][3] != 0.0f || 95bf215546Sopenharmony_ci dady[0][3] != 0.0f) { 96bf215546Sopenharmony_ci if (LP_DEBUG & DEBUG_LINEAR2) 97bf215546Sopenharmony_ci debug_printf(" -- w not constant\n"); 98bf215546Sopenharmony_ci goto fail; 99bf215546Sopenharmony_ci } 100bf215546Sopenharmony_ci 101bf215546Sopenharmony_ci /* XXX: Per statechange: 102bf215546Sopenharmony_ci */ 103bf215546Sopenharmony_ci int nr_consts; // in floats, not float[4] 104bf215546Sopenharmony_ci if (variant->shader->base.type == PIPE_SHADER_IR_TGSI) { 105bf215546Sopenharmony_ci nr_consts = (info->base.file_max[TGSI_FILE_CONSTANT] + 1) * 4; 106bf215546Sopenharmony_ci } else { 107bf215546Sopenharmony_ci nr_consts = state->jit_context.num_constants[0]; 108bf215546Sopenharmony_ci } 109bf215546Sopenharmony_ci for (int i = 0; i < nr_consts; i++){ 110bf215546Sopenharmony_ci float val = state->jit_context.constants[0][i]; 111bf215546Sopenharmony_ci if (val < 0.0f || val > 1.0f) { 112bf215546Sopenharmony_ci if (LP_DEBUG & DEBUG_LINEAR2) 113bf215546Sopenharmony_ci debug_printf(" -- const[%d] out of range %f\n", i, val); 114bf215546Sopenharmony_ci goto fail; 115bf215546Sopenharmony_ci } 116bf215546Sopenharmony_ci constants[i] = (uint8_t)(val * 255.0f); 117bf215546Sopenharmony_ci } 118bf215546Sopenharmony_ci 119bf215546Sopenharmony_ci struct lp_jit_linear_context jit; 120bf215546Sopenharmony_ci jit.constants = (const uint8_t (*)[4])constants; 121bf215546Sopenharmony_ci 122bf215546Sopenharmony_ci /* We assume BGRA ordering */ 123bf215546Sopenharmony_ci assert(variant->key.cbuf_format[0] == PIPE_FORMAT_B8G8R8X8_UNORM || 124bf215546Sopenharmony_ci variant->key.cbuf_format[0] == PIPE_FORMAT_B8G8R8A8_UNORM); 125bf215546Sopenharmony_ci 126bf215546Sopenharmony_ci jit.blend_color = 127bf215546Sopenharmony_ci state->jit_context.u8_blend_color[32] + 128bf215546Sopenharmony_ci (state->jit_context.u8_blend_color[16] << 8) + 129bf215546Sopenharmony_ci (state->jit_context.u8_blend_color[0] << 16) + 130bf215546Sopenharmony_ci (state->jit_context.u8_blend_color[48] << 24); 131bf215546Sopenharmony_ci 132bf215546Sopenharmony_ci jit.alpha_ref_value = float_to_ubyte(state->jit_context.alpha_ref_value); 133bf215546Sopenharmony_ci 134bf215546Sopenharmony_ci /* XXX: Per primitive: 135bf215546Sopenharmony_ci */ 136bf215546Sopenharmony_ci struct lp_linear_interp interp[LP_MAX_LINEAR_INPUTS]; 137bf215546Sopenharmony_ci const float oow = 1.0f / a0[0][3]; 138bf215546Sopenharmony_ci unsigned input_mask = variant->linear_input_mask; 139bf215546Sopenharmony_ci while (input_mask) { 140bf215546Sopenharmony_ci int i = u_bit_scan(&input_mask); 141bf215546Sopenharmony_ci unsigned usage_mask = info->base.input_usage_mask[i]; 142bf215546Sopenharmony_ci boolean perspective = 143bf215546Sopenharmony_ci info->base.input_interpolate[i] == TGSI_INTERPOLATE_PERSPECTIVE || 144bf215546Sopenharmony_ci (info->base.input_interpolate[i] == TGSI_INTERPOLATE_COLOR && 145bf215546Sopenharmony_ci !variant->key.flatshade); 146bf215546Sopenharmony_ci if (!lp_linear_init_interp(&interp[i], 147bf215546Sopenharmony_ci x, y, width, height, 148bf215546Sopenharmony_ci usage_mask, 149bf215546Sopenharmony_ci perspective, 150bf215546Sopenharmony_ci oow, 151bf215546Sopenharmony_ci a0[i+1], 152bf215546Sopenharmony_ci dadx[i+1], 153bf215546Sopenharmony_ci dady[i+1])) { 154bf215546Sopenharmony_ci if (LP_DEBUG & DEBUG_LINEAR2) 155bf215546Sopenharmony_ci debug_printf(" -- init_interp(%d) failed\n", i); 156bf215546Sopenharmony_ci goto fail; 157bf215546Sopenharmony_ci } 158bf215546Sopenharmony_ci 159bf215546Sopenharmony_ci jit.inputs[i] = &interp[i].base; 160bf215546Sopenharmony_ci } 161bf215546Sopenharmony_ci 162bf215546Sopenharmony_ci /* XXX: Per primitive: Initialize linear or nearest samplers: 163bf215546Sopenharmony_ci */ 164bf215546Sopenharmony_ci struct lp_linear_sampler samp[LP_MAX_LINEAR_TEXTURES]; 165bf215546Sopenharmony_ci const int nr_tex = info->num_texs; 166bf215546Sopenharmony_ci for (int i = 0; i < nr_tex; i++) { 167bf215546Sopenharmony_ci const struct lp_tgsi_texture_info *tex_info = &info->tex[i]; 168bf215546Sopenharmony_ci const unsigned tex_unit = tex_info->texture_unit; 169bf215546Sopenharmony_ci const unsigned samp_unit = tex_info->sampler_unit; 170bf215546Sopenharmony_ci //const unsigned fs_s_input = tex_info->coord[0].u.index; 171bf215546Sopenharmony_ci //const unsigned fs_t_input = tex_info->coord[1].u.index; 172bf215546Sopenharmony_ci 173bf215546Sopenharmony_ci // xxx investigate why these fail in deqp-vk 174bf215546Sopenharmony_ci //assert(variant->linear_input_mask & (1 << fs_s_input)); 175bf215546Sopenharmony_ci //assert(variant->linear_input_mask & (1 << fs_t_input)); 176bf215546Sopenharmony_ci 177bf215546Sopenharmony_ci /* XXX: some texture coordinates are linear! 178bf215546Sopenharmony_ci */ 179bf215546Sopenharmony_ci //boolean perspective = (info->base.input_interpolate[i] == 180bf215546Sopenharmony_ci // TGSI_INTERPOLATE_PERSPECTIVE); 181bf215546Sopenharmony_ci 182bf215546Sopenharmony_ci if (!lp_linear_init_sampler(&samp[i], tex_info, 183bf215546Sopenharmony_ci lp_fs_variant_key_sampler_idx(&variant->key, samp_unit), 184bf215546Sopenharmony_ci &state->jit_context.textures[tex_unit], 185bf215546Sopenharmony_ci x, y, width, height, a0, dadx, dady)) { 186bf215546Sopenharmony_ci if (LP_DEBUG & DEBUG_LINEAR2) 187bf215546Sopenharmony_ci debug_printf(" -- init_sampler(%d) failed\n", i); 188bf215546Sopenharmony_ci goto fail; 189bf215546Sopenharmony_ci } 190bf215546Sopenharmony_ci 191bf215546Sopenharmony_ci jit.tex[i] = &samp[i].base; 192bf215546Sopenharmony_ci } 193bf215546Sopenharmony_ci 194bf215546Sopenharmony_ci /* JIT function already does blending */ 195bf215546Sopenharmony_ci jit.color0 = color + x * 4 + y * stride; 196bf215546Sopenharmony_ci lp_jit_linear_llvm_func jit_func = variant->jit_linear_llvm; 197bf215546Sopenharmony_ci 198bf215546Sopenharmony_ci for (unsigned iy = 0; iy < height; iy++) { 199bf215546Sopenharmony_ci jit_func(&jit, 0, 0, width); // x=0, y=0 200bf215546Sopenharmony_ci jit.color0 += stride; 201bf215546Sopenharmony_ci } 202bf215546Sopenharmony_ci 203bf215546Sopenharmony_ci return TRUE; 204bf215546Sopenharmony_ci 205bf215546Sopenharmony_cifail: 206bf215546Sopenharmony_ci /* Visually distinguish this from other fallbacks: 207bf215546Sopenharmony_ci */ 208bf215546Sopenharmony_ci if (LP_DEBUG & DEBUG_LINEAR) { 209bf215546Sopenharmony_ci return linear_fallback(state, x, y, width, height, color, stride); 210bf215546Sopenharmony_ci } 211bf215546Sopenharmony_ci 212bf215546Sopenharmony_ci return FALSE; 213bf215546Sopenharmony_ci} 214bf215546Sopenharmony_ci 215bf215546Sopenharmony_ci 216bf215546Sopenharmony_cistatic void 217bf215546Sopenharmony_cicheck_linear_interp_mask_a(struct lp_fragment_shader_variant *variant) 218bf215546Sopenharmony_ci{ 219bf215546Sopenharmony_ci const struct lp_tgsi_info *info = &variant->shader->info; 220bf215546Sopenharmony_ci struct lp_jit_linear_context jit; 221bf215546Sopenharmony_ci 222bf215546Sopenharmony_ci struct lp_linear_sampler samp[LP_MAX_LINEAR_TEXTURES]; 223bf215546Sopenharmony_ci struct lp_linear_interp interp[LP_MAX_LINEAR_INPUTS]; 224bf215546Sopenharmony_ci uint8_t constants[LP_MAX_LINEAR_CONSTANTS][4]; 225bf215546Sopenharmony_ci alignas(16) uint8_t color0[TILE_SIZE*4]; 226bf215546Sopenharmony_ci 227bf215546Sopenharmony_ci const int nr_inputs = info->base.file_max[TGSI_FILE_INPUT]+1; 228bf215546Sopenharmony_ci const int nr_tex = info->num_texs; 229bf215546Sopenharmony_ci 230bf215546Sopenharmony_ci LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__); 231bf215546Sopenharmony_ci 232bf215546Sopenharmony_ci jit.constants = (const uint8_t (*)[4])constants; 233bf215546Sopenharmony_ci 234bf215546Sopenharmony_ci for (int i = 0; i < nr_tex; i++) { 235bf215546Sopenharmony_ci lp_linear_init_noop_sampler(&samp[i]); 236bf215546Sopenharmony_ci jit.tex[i] = &samp[i].base; 237bf215546Sopenharmony_ci } 238bf215546Sopenharmony_ci 239bf215546Sopenharmony_ci for (int i = 0; i < nr_inputs; i++) { 240bf215546Sopenharmony_ci lp_linear_init_noop_interp(&interp[i]); 241bf215546Sopenharmony_ci jit.inputs[i] = &interp[i].base; 242bf215546Sopenharmony_ci } 243bf215546Sopenharmony_ci 244bf215546Sopenharmony_ci jit.color0 = color0; 245bf215546Sopenharmony_ci 246bf215546Sopenharmony_ci (void)variant->jit_linear_llvm(&jit, 0, 0, 0); 247bf215546Sopenharmony_ci 248bf215546Sopenharmony_ci /* Find out which interpolators were called, and store this as a 249bf215546Sopenharmony_ci * mask: 250bf215546Sopenharmony_ci */ 251bf215546Sopenharmony_ci for (int i = 0; i < nr_inputs; i++) { 252bf215546Sopenharmony_ci variant->linear_input_mask |= (interp[i].row[0] << i); 253bf215546Sopenharmony_ci } 254bf215546Sopenharmony_ci} 255bf215546Sopenharmony_ci 256bf215546Sopenharmony_ci 257bf215546Sopenharmony_ci/* Until the above is working, look at texture information and guess 258bf215546Sopenharmony_ci * that any input used as a texture coordinate is not used for 259bf215546Sopenharmony_ci * anything else. 260bf215546Sopenharmony_ci */ 261bf215546Sopenharmony_cistatic void 262bf215546Sopenharmony_cicheck_linear_interp_mask_b(struct lp_fragment_shader_variant *variant) 263bf215546Sopenharmony_ci{ 264bf215546Sopenharmony_ci const struct lp_tgsi_info *info = &variant->shader->info; 265bf215546Sopenharmony_ci int nr_inputs = info->base.file_max[TGSI_FILE_INPUT]+1; 266bf215546Sopenharmony_ci int nr_tex = info->num_texs; 267bf215546Sopenharmony_ci unsigned tex_mask = 0; 268bf215546Sopenharmony_ci int i; 269bf215546Sopenharmony_ci 270bf215546Sopenharmony_ci LP_DBG(DEBUG_RAST, "%s\n", __FUNCTION__); 271bf215546Sopenharmony_ci 272bf215546Sopenharmony_ci for (i = 0; i < nr_tex; i++) { 273bf215546Sopenharmony_ci const struct lp_tgsi_texture_info *tex_info = &info->tex[i]; 274bf215546Sopenharmony_ci const struct lp_tgsi_channel_info *schan = &tex_info->coord[0]; 275bf215546Sopenharmony_ci const struct lp_tgsi_channel_info *tchan = &tex_info->coord[1]; 276bf215546Sopenharmony_ci tex_mask |= 1 << schan->u.index; 277bf215546Sopenharmony_ci tex_mask |= 1 << tchan->u.index; 278bf215546Sopenharmony_ci } 279bf215546Sopenharmony_ci 280bf215546Sopenharmony_ci variant->linear_input_mask = ((1 << nr_inputs) - 1) & ~tex_mask; 281bf215546Sopenharmony_ci} 282bf215546Sopenharmony_ci 283bf215546Sopenharmony_ci 284bf215546Sopenharmony_civoid 285bf215546Sopenharmony_cilp_linear_check_variant(struct lp_fragment_shader_variant *variant) 286bf215546Sopenharmony_ci{ 287bf215546Sopenharmony_ci const struct lp_fragment_shader_variant_key *key = &variant->key; 288bf215546Sopenharmony_ci const struct lp_fragment_shader *shader = variant->shader; 289bf215546Sopenharmony_ci const struct lp_tgsi_info *info = &shader->info; 290bf215546Sopenharmony_ci 291bf215546Sopenharmony_ci if (info->base.file_max[TGSI_FILE_CONSTANT] >= LP_MAX_LINEAR_CONSTANTS || 292bf215546Sopenharmony_ci info->base.file_max[TGSI_FILE_INPUT] >= LP_MAX_LINEAR_INPUTS) { 293bf215546Sopenharmony_ci if (LP_DEBUG & DEBUG_LINEAR) 294bf215546Sopenharmony_ci debug_printf(" -- too many inputs/constants\n"); 295bf215546Sopenharmony_ci goto fail; 296bf215546Sopenharmony_ci } 297bf215546Sopenharmony_ci 298bf215546Sopenharmony_ci /* If we have a fastpath which implements the entire variant, use 299bf215546Sopenharmony_ci * that. 300bf215546Sopenharmony_ci */ 301bf215546Sopenharmony_ci if (lp_linear_check_fastpath(variant)) { 302bf215546Sopenharmony_ci return; 303bf215546Sopenharmony_ci } 304bf215546Sopenharmony_ci 305bf215546Sopenharmony_ci /* Otherwise, can we build up a spanline-based linear path for this 306bf215546Sopenharmony_ci * variant? 307bf215546Sopenharmony_ci */ 308bf215546Sopenharmony_ci 309bf215546Sopenharmony_ci /* Check static sampler state. 310bf215546Sopenharmony_ci */ 311bf215546Sopenharmony_ci for (unsigned i = 0; i < info->num_texs; i++) { 312bf215546Sopenharmony_ci const struct lp_tgsi_texture_info *tex_info = &info->tex[i]; 313bf215546Sopenharmony_ci const unsigned unit = tex_info->sampler_unit; 314bf215546Sopenharmony_ci 315bf215546Sopenharmony_ci /* XXX: Relax this once setup premultiplies by oow: 316bf215546Sopenharmony_ci */ 317bf215546Sopenharmony_ci if (info->base.input_interpolate[unit] != TGSI_INTERPOLATE_PERSPECTIVE) { 318bf215546Sopenharmony_ci if (LP_DEBUG & DEBUG_LINEAR) 319bf215546Sopenharmony_ci debug_printf(" -- samp[%d]: texcoord not perspective\n", i); 320bf215546Sopenharmony_ci goto fail; 321bf215546Sopenharmony_ci } 322bf215546Sopenharmony_ci 323bf215546Sopenharmony_ci struct lp_sampler_static_state *samp = 324bf215546Sopenharmony_ci lp_fs_variant_key_sampler_idx(key, unit); 325bf215546Sopenharmony_ci if (!lp_linear_check_sampler(samp, tex_info)) { 326bf215546Sopenharmony_ci if (LP_DEBUG & DEBUG_LINEAR) 327bf215546Sopenharmony_ci debug_printf(" -- samp[%d]: check_sampler failed\n", i); 328bf215546Sopenharmony_ci goto fail; 329bf215546Sopenharmony_ci } 330bf215546Sopenharmony_ci } 331bf215546Sopenharmony_ci 332bf215546Sopenharmony_ci /* Check shader. May not have been jitted. 333bf215546Sopenharmony_ci */ 334bf215546Sopenharmony_ci if (variant->linear_function == NULL) { 335bf215546Sopenharmony_ci if (LP_DEBUG & DEBUG_LINEAR) 336bf215546Sopenharmony_ci debug_printf(" -- no linear shader\n"); 337bf215546Sopenharmony_ci goto fail; 338bf215546Sopenharmony_ci } 339bf215546Sopenharmony_ci 340bf215546Sopenharmony_ci /* Hook in the catchall shader runner: 341bf215546Sopenharmony_ci */ 342bf215546Sopenharmony_ci variant->jit_linear = lp_fs_linear_run; 343bf215546Sopenharmony_ci 344bf215546Sopenharmony_ci /* Figure out which inputs we don't need to interpolate (because 345bf215546Sopenharmony_ci * they are only used as texture coordinates). This is important 346bf215546Sopenharmony_ci * as we can cope with texture coordinates which exceed 1.0, but 347bf215546Sopenharmony_ci * cannot do so for regular inputs. 348bf215546Sopenharmony_ci */ 349bf215546Sopenharmony_ci if (1) 350bf215546Sopenharmony_ci check_linear_interp_mask_a(variant); 351bf215546Sopenharmony_ci else 352bf215546Sopenharmony_ci check_linear_interp_mask_b(variant); 353bf215546Sopenharmony_ci 354bf215546Sopenharmony_ci 355bf215546Sopenharmony_ci if (0) { 356bf215546Sopenharmony_ci lp_debug_fs_variant(variant); 357bf215546Sopenharmony_ci debug_printf("linear input mask: 0x%x\n", variant->linear_input_mask); 358bf215546Sopenharmony_ci } 359bf215546Sopenharmony_ci 360bf215546Sopenharmony_ci return; 361bf215546Sopenharmony_ci 362bf215546Sopenharmony_cifail: 363bf215546Sopenharmony_ci if (LP_DEBUG & DEBUG_LINEAR) { 364bf215546Sopenharmony_ci lp_debug_fs_variant(variant); 365bf215546Sopenharmony_ci debug_printf(" ----> no linear path for this variant\n"); 366bf215546Sopenharmony_ci } 367bf215546Sopenharmony_ci} 368bf215546Sopenharmony_ci 369bf215546Sopenharmony_ci 370bf215546Sopenharmony_ci#else 371bf215546Sopenharmony_civoid 372bf215546Sopenharmony_cilp_linear_check_variant(struct lp_fragment_shader_variant *variant) 373bf215546Sopenharmony_ci{ 374bf215546Sopenharmony_ci} 375bf215546Sopenharmony_ci#endif 376