Path: blob/21.2-virgl/src/compiler/glsl/gl_nir_lower_samplers.c
4545 views
/*1* Copyright (C) 2005-2007 Brian Paul All Rights Reserved.2* Copyright (C) 2008 VMware, Inc. All Rights Reserved.3* Copyright © 2014 Intel Corporation4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the "Software"),7* to deal in the Software without restriction, including without limitation8* the rights to use, copy, modify, merge, publish, distribute, sublicense,9* and/or sell copies of the Software, and to permit persons to whom the10* Software is furnished to do so, subject to the following conditions:11*12* The above copyright notice and this permission notice (including the next13* paragraph) shall be included in all copies or substantial portions of the14* Software.15*16* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR17* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,18* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL19* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER20* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING21* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER22* DEALINGS IN THE SOFTWARE.23*/2425#include "compiler/nir/nir.h"26#include "gl_nir.h"2728bool29gl_nir_lower_samplers(nir_shader *shader,30const struct gl_shader_program *shader_program)31{32/* First, use gl_nir_lower_samplers_as_derefs to set var->data.binding33* based on the uniforms, and split structures to simplify derefs.34*/35gl_nir_lower_samplers_as_deref(shader, shader_program);3637return nir_lower_samplers(shader);38}394041