mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-04-08 16:04:39 +00:00
Added support for NVX_gpu_memory_info (experimental extension).
Added support for initializing extensions that are not exposed in GL_EXTENSIONS (enables EXT_direct_state_access and NV_primitive_restart on AMD GPUs, use at your own risk). Updated @Optional functions for AMD GPUs (driver version: 10.3)
This commit is contained in:
parent
bd6ac573d5
commit
6e738cc2b6
12 changed files with 168 additions and 9 deletions
|
|
@ -164,6 +164,8 @@ public class ContextCapabilitiesGenerator {
|
|||
public static void generateInitStubs(PrintWriter writer, InterfaceDeclaration d, boolean context_specific) {
|
||||
if ( d.getMethods().size() > 0 ) {
|
||||
if ( context_specific ) {
|
||||
if ( d.getAnnotation(ForceInit.class) != null )
|
||||
writer.println("\t\t" + CACHED_EXTS_VAR_NAME + ".add(\"" + translateFieldName(d.getSimpleName()) + "\");");
|
||||
writer.print("\t\tif (" + CACHED_EXTS_VAR_NAME + ".contains(\"");
|
||||
writer.print(translateFieldName(d.getSimpleName()) + "\")");
|
||||
writer.print(" && !" + getAddressesInitializerName(d.getSimpleName()) + "(");
|
||||
|
|
@ -218,7 +220,7 @@ public class ContextCapabilitiesGenerator {
|
|||
continue;
|
||||
|
||||
if ( !first )
|
||||
writer.println(" &&");
|
||||
writer.println(" &");
|
||||
else
|
||||
first = false;
|
||||
|
||||
|
|
|
|||
45
src/java/org/lwjgl/util/generator/ForceInit.java
Normal file
45
src/java/org/lwjgl/util/generator/ForceInit.java
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* Copyright (c) 2002-2008 LWJGL Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* * Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* * Neither the name of 'LWJGL' nor the names of
|
||||
* its contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
package org.lwjgl.util.generator;
|
||||
|
||||
/**
|
||||
* Extensions marked with ForceInit will be initialized by LWJGL even if not exposed in the GL_EXTENSIONS string.
|
||||
*
|
||||
* @author spasi
|
||||
*/
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target({ ElementType.TYPE })
|
||||
public @interface ForceInit {
|
||||
}
|
||||
|
|
@ -186,6 +186,7 @@ public class GeneratorVisitor extends SimpleDeclarationVisitor {
|
|||
//java_writer.println("import org.lwjgl.NondirectBufferWrapper;");
|
||||
java_writer.println("import java.nio.*;");
|
||||
java_writer.println();
|
||||
Utils.printDocComment(java_writer, d);
|
||||
java_writer.print("public ");
|
||||
boolean is_final = Utils.isFinal(d);
|
||||
if (is_final)
|
||||
|
|
|
|||
|
|
@ -149,11 +149,12 @@ public class Utils {
|
|||
public static void printDocComment(PrintWriter writer, Declaration decl) {
|
||||
String doc_comment = decl.getDocComment();
|
||||
if (doc_comment != null) {
|
||||
writer.println("\t/**");
|
||||
String tab = decl instanceof InterfaceDeclaration ? "" : "\t";
|
||||
writer.println(tab + "/**");
|
||||
StringTokenizer doc_lines = new StringTokenizer(doc_comment, "\n");
|
||||
while (doc_lines.hasMoreTokens())
|
||||
writer.println("\t *" + doc_lines.nextToken());
|
||||
writer.println("\t */");
|
||||
writer.println(tab + " * " + doc_lines.nextToken());
|
||||
writer.println(tab + " */");
|
||||
} else if ( (decl instanceof MethodDeclaration) && decl.getAnnotation(Alternate.class) != null )
|
||||
writer.println("\t/** Overloads " + decl.getAnnotation(Alternate.class).value() + " */");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue