blob: d1476c2b57ec856ccbccd1bba6978031948c0015 [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"
30#include "dev.h"
31
32typedef enum _SHADER_TYPE
33{
34 SHADER_TYPE_VERTEX = 0x0,
35 SHADER_TYPE_FRAGMENT = 0x1,
36 SHADER_TYPE_GEOMETRY = 0x2,
37 SHADER_TYPE_COMPUTE = 0x3,
38 SHADER_TYPE_TESS_CONTROL = 0x4,
39 SHADER_TYPE_TESS_EVALUATION = 0x5
40} INTEL_SHADER_TYPE;
41
42struct intel_shader {
43 struct intel_obj obj;
44 struct intel_dev *dev;
45
46 void *pCode;
47 uint32_t codeSize;
48};
49
50XGL_RESULT XGLAPI intelCreateShader(
51 XGL_DEVICE device,
52 const XGL_SHADER_CREATE_INFO* pCreateInfo,
53 XGL_SHADER* pShader);
54
55static inline struct intel_shader *intel_shader(XGL_SHADER shader)
56{
57 return (struct intel_shader *) shader;
58}
59
60static inline struct intel_shader *intel_shader_from_obj(struct intel_obj *obj)
61{
62 return (struct intel_shader *) obj;
63}
64
65#endif // SHADER_H