1 /****************************************************************************
2 * Copyright (C) 2015 Intel Corporation. All Rights Reserved.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 ***************************************************************************/
26 struct swr_vertex_shader
;
27 struct swr_fragment_shader
;
28 struct swr_jit_fs_key
;
29 struct swr_jit_vs_key
;
32 swr_compile_vs(struct swr_context
*ctx
, swr_jit_vs_key
&key
);
35 swr_compile_fs(struct swr_context
*ctx
, swr_jit_fs_key
&key
);
37 void swr_generate_fs_key(struct swr_jit_fs_key
&key
,
38 struct swr_context
*ctx
,
39 swr_fragment_shader
*swr_fs
);
41 void swr_generate_vs_key(struct swr_jit_vs_key
&key
,
42 struct swr_context
*ctx
,
43 swr_vertex_shader
*swr_vs
);
45 struct swr_jit_sampler_key
{
47 unsigned nr_sampler_views
;
48 struct swr_sampler_static_state sampler
[PIPE_MAX_SHADER_SAMPLER_VIEWS
];
51 struct swr_jit_fs_key
: swr_jit_sampler_key
{
53 unsigned light_twoside
;
55 ubyte vs_output_semantic_name
[PIPE_MAX_SHADER_OUTPUTS
];
56 ubyte vs_output_semantic_idx
[PIPE_MAX_SHADER_OUTPUTS
];
59 struct swr_jit_vs_key
: swr_jit_sampler_key
{
64 template <> struct hash
<swr_jit_fs_key
> {
65 std::size_t operator()(const swr_jit_fs_key
&k
) const
67 return util_hash_crc32(&k
, sizeof(k
));
71 template <> struct hash
<swr_jit_vs_key
> {
72 std::size_t operator()(const swr_jit_vs_key
&k
) const
74 return util_hash_crc32(&k
, sizeof(k
));
79 bool operator==(const swr_jit_fs_key
&lhs
, const swr_jit_fs_key
&rhs
);
80 bool operator==(const swr_jit_vs_key
&lhs
, const swr_jit_vs_key
&rhs
);