11b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke/*
21b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * Copyright © 2011 Intel Corporation
31b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke *
41b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * Permission is hereby granted, free of charge, to any person obtaining a
51b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * copy of this software and associated documentation files (the "Software"),
61b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * to deal in the Software without restriction, including without limitation
71b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * the rights to use, copy, modify, merge, publish, distribute, sublicense,
81b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * and/or sell copies of the Software, and to permit persons to whom the
91b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * Software is furnished to do so, subject to the following conditions:
101b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke *
111b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * The above copyright notice and this permission notice (including the next
121b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * paragraph) shall be included in all copies or substantial portions of the
131b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * Software.
141b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke *
151b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
161b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
171b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
181b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
191b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
201b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
211b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * IN THE SOFTWARE.
221b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke */
231b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke
241b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke#ifndef BRW_PROGRAM_H
251b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke#define BRW_PROGRAM_H
261b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke
271b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke/**
281b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke * Sampler information needed by VS, WM, and GS program cache keys.
291b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke */
301b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunkestruct brw_sampler_prog_key_data {
311b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke   /**
321b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke    * EXT_texture_swizzle and DEPTH_TEXTURE_MODE swizzles.
331b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke    */
34f3d0daf7ea7e42ff9ce11e8bd6fba1059a2406e8Kenneth Graunke   uint16_t swizzles[MAX_SAMPLERS];
351b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke
361b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke   uint16_t gl_clamp_mask[3];
371b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke
381b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke   /**
391b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke    * YUV conversions, needed for the GL_MESA_ycbcr extension.
401b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke    */
411b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke   uint16_t yuvtex_mask;
421b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke   uint16_t yuvtex_swap_mask; /**< UV swaped */
431b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke};
441b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke
451b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunkevoid brw_populate_sampler_prog_key_data(struct gl_context *ctx,
46fe911c1d433c6fddc8f1e1226286b26d635d6ad4Kenneth Graunke				        const struct gl_program *prog,
47fe911c1d433c6fddc8f1e1226286b26d635d6ad4Kenneth Graunke				        struct brw_sampler_prog_key_data *key);
48fc3b7c9b56701f23b002543de33a8d8c43f9bdc2Eric Anholtbool brw_debug_recompile_sampler_key(const struct brw_sampler_prog_key_data *old_key,
49fc3b7c9b56701f23b002543de33a8d8c43f9bdc2Eric Anholt                                     const struct brw_sampler_prog_key_data *key);
501b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke
511b05fc7cdd0e5d77b50bc8ee2f2c851da5884d72Kenneth Graunke#endif
52