author | aghaisas |
Wed, 20 Feb 2019 17:00:40 +0530 | |
branch | metal-prototype-branch |
changeset 57196 | a95707a39ff5 |
permissions | -rw-r--r-- |
57196
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
1 |
/* |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
2 |
* Copyright (c) 2019, 2019, Oracle and/or its affiliates. All rights reserved. |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
4 |
* |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. Oracle designates this |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
10 |
* |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
15 |
* accompanied this code). |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
16 |
* |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
20 |
* |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
22 |
* or visit www.oracle.com if you need additional information or have any |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
23 |
* questions. |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
24 |
*/ |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
25 |
|
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
26 |
#ifndef MetalRenderQueue_h_Included |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
27 |
#define MetalRenderQueue_h_Included |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
28 |
|
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
29 |
//#include "MetalContext.h" |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
30 |
#include "MetalSurfaceData.h" |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
31 |
|
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
32 |
MetalSDOps *MetalRenderQueue_GetCurrentDestination(); |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
33 |
|
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
34 |
/* |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
35 |
* The following macros are used to pick values (of the specified type) off |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
36 |
* the queue. |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
37 |
*/ |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
38 |
#define NEXT_VAL(buf, type) (((type *)((buf) += sizeof(type)))[-1]) |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
39 |
#define NEXT_BYTE(buf) NEXT_VAL(buf, unsigned char) |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
40 |
#define NEXT_INT(buf) NEXT_VAL(buf, jint) |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
41 |
#define NEXT_FLOAT(buf) NEXT_VAL(buf, jfloat) |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
42 |
#define NEXT_BOOLEAN(buf) (jboolean)NEXT_INT(buf) |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
43 |
#define NEXT_LONG(buf) NEXT_VAL(buf, jlong) |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
44 |
#define NEXT_DOUBLE(buf) NEXT_VAL(buf, jdouble) |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
45 |
|
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
46 |
/* |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
47 |
* Increments a pointer (buf) by the given number of bytes. |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
48 |
*/ |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
49 |
#define SKIP_BYTES(buf, numbytes) buf += (numbytes) |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
50 |
|
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
51 |
/* |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
52 |
* Extracts a value at the given offset from the provided packed value. |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
53 |
*/ |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
54 |
#define EXTRACT_VAL(packedval, offset, mask) \ |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
55 |
(((packedval) >> (offset)) & (mask)) |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
56 |
#define EXTRACT_BYTE(packedval, offset) \ |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
57 |
(unsigned char)EXTRACT_VAL(packedval, offset, 0xff) |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
58 |
#define EXTRACT_BOOLEAN(packedval, offset) \ |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
59 |
(jboolean)EXTRACT_VAL(packedval, offset, 0x1) |
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
60 |
|
a95707a39ff5
Description : Metal Rendering Pipeline - initial implementation of line and quad rendering
aghaisas
parents:
diff
changeset
|
61 |
#endif /*MetalRenderQueue_h_Included*/ |