blob: 61f2011f4d4141444db0834d39bfaeec7051f0ae [file] [log] [blame]
Courtney Goeltzenleuchter52ec3362014-08-19 11:52:02 -06001/*
2 * XGL
3 *
4 * Copyright (C) 2014 LunarG, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
23 */
24
25#ifndef SHADER_H
26#define SHADER_H
27
28#include "intel.h"
29#include "obj.h"
Courtney Goeltzenleuchter52ec3362014-08-19 11:52:02 -060030
Chia-I Wuc123b7f2014-08-28 12:18:43 +080031enum intel_shader_use {
32 INTEL_SHADER_USE_VID = (1 << 0),
33 INTEL_SHADER_USE_IID = (1 << 1),
34};
35
Chia-I Wu9194a6d2014-08-28 11:36:48 +080036/* just the kernel now */
37struct intel_ir {
38 void *kernel;
39 XGL_SIZE size;
40};
Courtney Goeltzenleuchter52ec3362014-08-19 11:52:02 -060041
42struct intel_shader {
43 struct intel_obj obj;
Courtney Goeltzenleuchter52ec3362014-08-19 11:52:02 -060044
Chia-I Wu9194a6d2014-08-28 11:36:48 +080045 struct intel_ir *ir;
Chia-I Wuc123b7f2014-08-28 12:18:43 +080046 XGL_FLAGS uses;
47 XGL_UINT in_count;
48 XGL_UINT out_count;
Courtney Goeltzenleuchter52ec3362014-08-19 11:52:02 -060049};
50
Courtney Goeltzenleuchter52ec3362014-08-19 11:52:02 -060051static inline struct intel_shader *intel_shader(XGL_SHADER shader)
52{
53 return (struct intel_shader *) shader;
54}
55
56static inline struct intel_shader *intel_shader_from_obj(struct intel_obj *obj)
57{
58 return (struct intel_shader *) obj;
59}
60
Chia-I Wu9194a6d2014-08-28 11:36:48 +080061XGL_RESULT XGLAPI intelCreateShader(
62 XGL_DEVICE device,
63 const XGL_SHADER_CREATE_INFO* pCreateInfo,
64 XGL_SHADER* pShader);
65
66#endif /* SHADER_H */